Saleh127

UVA 10784

Sep 12th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);
  9. cout.tie(0);
  10.  
  11. ll tt=1,n,ans;
  12. while(cin>>n && n)
  13. {
  14.  
  15. cout<<"Case "<<tt<<": ";
  16. tt++;
  17.  
  18. ans=ceil((3+sqrt(9+8*n))/2);
  19.  
  20. cout<<ans<<endl;
  21.  
  22. }
  23.  
  24. return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment