Skip to content

Instantly share code, notes, and snippets.

@zhrkvl
Created July 6, 2015 13:11
Show Gist options
  • Select an option

  • Save zhrkvl/eb5f271c282504ec6458 to your computer and use it in GitHub Desktop.

Select an option

Save zhrkvl/eb5f271c282504ec6458 to your computer and use it in GitHub Desktop.
lelpas
withFile = 0
if(withFile == 1):
fin = open('input.txt', 'r')
fout = open('output.txt', 'w')
def getl():
if(withFile == 0):
return input()
else:
return fin.readline()
def printl(s):
if(withFile == 0):
print(s)
else:
fout.write(str(s))
def get_arr():
x = getl().split(' ')
if(x[-1] == ''):
x = x[:-1]
return list(map(int, x))
n = get_arr()[0]
if(n % 2):
print(int((n-1) / 2 - n))
else:
print(n / 2)
if(withFile == 1):
fin.close()
fout.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment