-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathG.cpp
More file actions
47 lines (38 loc) · 640 Bytes
/
G.cpp
File metadata and controls
47 lines (38 loc) · 640 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define f first
#define s second
#define all(s) s.begin(), s.end()
#define sz(a) (int)a.size()
const int mod = 1e9+7;
void solve(){
}
int main(){
int n,k;
cin>>n>>k;
while(n!=-1, k!=-1){
double a,b;
a = min(n,k);
b = max(n,k);
if((a==b || b==a+1) && a!=0){
cout<<1<<"\n";
cin>>n>>k;
continue;
}
if(a==1 && b!=1){
cout<<ceil((double)b/2)<<"\n";
cin>>n>>k;
continue;
}
if(a==0){
cout<<(int)b<<"\n";
cin>>n>>k;
continue;
}
cout<<ceil((double)b/(a+1))<<"\n";
cin>>n>>k;
}
return 0;
}