515A - Drazil and Date - CodeForces Solution


math *1000

Please click on ads to support us..

Python Code:

def isr(x,y):
    if (x,y)==(0,0):
        return 0
    else:
        return abs(x)+abs(y)    
a , b , s =  map(int,input().split())
t = isr(a,b)
if t<s :
    if (s-t)%2 !=0:
     print("NO")    
    else:
        print("YES")
elif t==s:
    print("YES")
else:
    print("NO")            

C++ Code:

#include <bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
int arr[10000];
int main()
{
    FIO;

long long a , b ,s ;
cin>>a>>b>>s;
if (a < 0 )
a = a * -1 ;
if (b<0)
b = b * -1;
if (s >= (a+b))
{
    if ((s-(a+b) )%2 ==0)
        cout <<"YES";
    else
        cout <<"NO";
}
else
 cout <<"NO";
    return 0;
    
}






Comments

Submit
0 Comments
More Questions

199A - Hexadecimal's theorem
519C - A and B and Team Training
631A - Interview
961B - Lecture Sleep
522A - Reposts
1166D - Cute Sequences
1176A - Divide it
1527A - And Then There Were K
1618E - Singers' Tour
1560B - Who's Opposite
182B - Vasya's Calendar
934A - A Compatible Pair
1618F - Reverse
1684C - Column Swapping
57C - Array
1713D - Tournament Countdown
33A - What is for dinner
810A - Straight A
1433C - Dominant Piranha
633A - Ebony and Ivory
1196A - Three Piles of Candies
299A - Ksusha and Array
448B - Suffix Structures
1092B - Teams Forming
1166C - A Tale of Two Lands
544B - Sea and Islands
152B - Steps
1174D - Ehab and the Expected XOR Problem
1511A - Review Site
1316A - Grade Allocation