Codeforces problem A A. Sum of Odd Integers Round 84

https://codeforces.com/contest/1327/problem/A

Can anyone find out the error in the above code

t = int(input())
for i in range (t):
n, k = list(map(int, input().split()))
if k == 1:
if n % 2 != 0:
print(‘Yes’)
else:
print(‘No’)

if k == 0:
    print('No')

if k != 1:
    if k % 2 == 0:
        if n % 2 == 0:
            print('Yes')
        else:
            print('No')
    if k % 2 != 0:
        if n % 2 != 0:
            print('Yes')
        else:
            print('No')

Consider the test case

Blockquote
1
2 2

Your code outputs Yes

1 Like

thnks:)

1 Like