Created
May 28, 2016 20:06
-
-
Save popey456963/8260381aeae2459027b4ed575dab45ad to your computer and use it in GitHub Desktop.
Alternating Sign Sequence
This file contains hidden or 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
n,k=int(input()),0 | |
if not n-1%3:k=0 | |
elif not n%3:k=(n/3)+1 | |
else:k=-(n/3)+1 | |
print(k) |
developius
commented
May 28, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment