Advertisement
artemgf

Chernobyl’ Eagles

Dec 17th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. n = int(input())
  2. if(n<=1):
  3.   print(n)
  4.   exit()
  5. if(n%3==0):
  6.   print(3**(n//3))
  7. else:
  8.   if(n%3==1):
  9.     print((3**(n//3-1))*4)
  10.   else:
  11.     if(n%3==2):
  12.       print((3**(n//3))*2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement