Header Ads

Header ADS

1150.Exceeding Z in python

This is the solution of the problem in python:

X=int(input())
while(1):
    Z=int(input())
    if(Z>X):
        break
Sum=X
Count=1
i=X
while(Sum<=Z):
    Sum+=Count+X
    Count+=1
print(Count)

No comments

Powered by Blogger.