forked from bamsarts/DS-ALGO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PHT.cpp
34 lines (27 loc) · 817 Bytes
/
PHT.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<bits/stdc++.h>
#define ll long long int
#define watch(x) cout << (#x) << " is " << (x) << endl //watch function print variable and value for debugging
#define count_ones __builtin_popcountll // count_ones(9) is equal to 2 valid for ll also
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define fo(i,n) for(ll i=0;i<n;i++)
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
fast_io
ll t;
cin>>t;
for(int i=0;i<t;i++)
{
ll n,ans=0;
cin>>n;
if(n<3)
ans=0;
else
ans=sqrt(1+n)-1;
cout<<"Case "<<(i+1)<<": "<<ans<<"\n";
}
return 0;
}