fork download
  1. import math
  2.  
  3. t = int(input())
  4.  
  5. while t > 0 :
  6. n = int(input())
  7.  
  8. m = int((math.sqrt(1+8*n)-1)/2)
  9.  
  10. o = int(m*(m+1)/2)
  11.  
  12. n -= o
  13.  
  14. if n < 1 :
  15. print(m)
  16. else:
  17. print(m+1)
  18. t = t-1
Success #stdin #stdout 0.04s 9440KB
stdin
3
3
4
5
stdout
2
3
3