19 December 2017

UVA 11614 Python solution

import math
n = int(input())
i=1
while i<=n:
x = int(input())
d = (-1 + math.sqrt(1 + 8 * x)) / 2
print(int(d))
i = i+1

No comments:

Post a Comment

UVA 10679 - I Love Strings!!