Problem Solution

1 solutions

  • 4
    @ 2024-01-04 11:18:42

    t=int(input())
    if 1<=t<=10**5:
    for i in range(t):
    n = int(input())
    if 1 <= n <= 10 ** 9:
    if n % 4 == 0:
    print(n)
    if n % 4 == 1 or n == 1:
    print(1)
    if n % 4 == 2 or n == 2:
    print(n + 1)
    if n % 4 == 3 or n == 3:
    print(0)

  • 1

Information

ID
1009
Difficulty
5
Category
Number_Theory , Simulation Click to Show
Tags
(None)
# Submissions
48
Accepted
17
Accepted Ratio
35%
Uploaded By