info@sislbd.com +8801775 012 358

UVA Online Judge – 10170 – The Hotel with Infinite Rooms

#include <stdio.h>

int main()
{
long S,D,sum;
while(scanf(“%ld%ld”,&S,&D)==2)
{
sum=0;
while(D > sum)
{
sum += S;
S += 1;
} // End of inner while
printf(“%ld\n”,S-1);
} // End of while
} // End of main

spectrum