n=int(input()) def f(n,a,b,c,x): y=x//b z=x%b res=a*x+((y-1)*c)*(b*y)//2+z*y*c return res>=n a,b,c=map(int,input().split()) l,r=1,n while l+1