Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # 38A : ARMY
  2. # Prerequisite : Implementation
  3.  
  4. # Take the necessary inputs
  5. n=int(raw_input())
  6. years=map(int,raw_input().split())
  7. a,b=map(int,raw_input().split())
  8.  
  9. # Sum up the necessary years
  10. sum=0
  11. for i in range(a-1,b-1):sum+=years[i]
  12.  
  13. # Display the result
  14. print sum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement