Codeforces problem A A. Sum of Odd Integers Round 84

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