marat_snowbear

Andrew Stankevich Contest 1 Problem A Python solution

Jun 8th, 2015
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. n = int(open('china.in', 'r').readline())
  2.  
  3. half = n // 2
  4.  
  5. if n % 2 == 1:
  6.     ans = half
  7. elif (half - 1) % 2 == 1:
  8.     ans = half - 1
  9. else:
  10.     ans = half - 2
  11.        
  12. open('china.out', 'w').write(str(ans))
Advertisement
Add Comment
Please, Sign In to add comment