Created
September 27, 2015 17:54
-
-
Save nickedes/ccfe26d5e334c14005fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# XOR of first N natural no.s | |
N = int(input()) | |
if (N % 2) == 0: | |
if (N % 4) == 0: | |
r = N | |
else: | |
r = N+1 | |
else: | |
if (N % 4) == 1: | |
r = 1 | |
else: | |
r = 0 | |
print(r) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment