DeukausGames

Pares de numeros - Obi 2020

Feb 18th, 2020
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. #https://olimpiada.ic.unicamp.br/static/extras/obi2019/provas/ProvaOBI2019_f3pj.pdf
  2. N,I,F = [int(i) for i in input().split()]
  3. V = [int(i) for i in input().split()]
  4. quant = 0
  5. V = sorted(V)
  6.  
  7. for a in range(N):
  8.     for b in range(a+1,N):
  9.         if (V[a]+V[b]) >= I and (V[a]+V[b]) <= F:
  10.             quant += 1
  11.  
  12. print(quant)
Advertisement
Add Comment
Please, Sign In to add comment