-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSolution.py
24 lines (19 loc) · 892 Bytes
/
Solution.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/CANDYDIST
"""
# Question link: https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/CANDYDIST
import webbrowser
# Open the link when required
webbrowser.open("https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/CANDYDIST")
print("Visit the question page: https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/CANDYDIST")
t = int(input()) # Number of test cases
for _ in range(t):
n, x = map(int, input().split()) # Read candies (n) and group size (x)
if n % x == 0: # Check if candies can be distributed evenly
even = n // x # Calculate the number of groups
if even % 2 == 0: # Check if the number of groups is even
print("YES")
else:
print("NO")
else:
print("NO")