Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A = int(input())
- B = int(input())
- if A %2 == 1 and B % 2 ==1:
- print(int(-((B - A)/2) - A))
- elif A % 2 == 1 and B % 2 ==0:
- print(int((B-A + 1)/2))
- elif A % 2 == 0 and B % 2 == 1:
- print(int(-(B-A + 1)/2))
- elif A % 2 == 0 and B % 2 == 0:
- print(int(-((B - A)/2)+B))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement