Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. A = int(input())
  2. B = int(input())
  3. if A %2 == 1 and B % 2 ==1:
  4. print(int(-((B - A)/2) - A))
  5. elif A % 2 == 1 and B % 2 ==0:
  6. print(int((B-A + 1)/2))
  7. elif A % 2 == 0 and B % 2 == 1:
  8. print(int(-(B-A + 1)/2))
  9. elif A % 2 == 0 and B % 2 == 0:
  10. print(int(-((B - A)/2)+B))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement