Advertisement
noshin98

uva 10170

Jul 14th, 2016
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     long int s,d,i,n;
  5.     while(scanf("%ld%ld",&s,&d)==2)
  6.     {
  7.         n=0;
  8.         for(i=s;;i++)
  9.         {
  10.             n=n+i;
  11.             if(n>=d)
  12.             {
  13.                 printf("%ld\n",i);
  14.                 break;
  15.             }
  16.         }
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement