今天來解YKL12(UVA10170):The Hotel with Infinite Rooms
input:
第一個參數是S
第二個參數是D
output:
第D天的group size S
大概長下圖這樣
#include <iostream>
using namespace std;
int main(){
long long S,D;
while(cin >> S >> D){
long long curr = 0;
while(curr < D){
curr += S;
if(curr >= D){
cout << S << endl;
break;
}
S++;
}
}
return 0;
}