-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumberingRoads.cpp
More file actions
49 lines (46 loc) · 1.39 KB
/
Copy pathNumberingRoads.cpp
File metadata and controls
49 lines (46 loc) · 1.39 KB
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
48
49
#include <iostream>
using namespace std;
#define endl '\n'
#define FO(i, b) for (int i = 0; i < (b); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rFOR(i, a, b) for (int i = (a); i > (b); i--)
#define TR(v, arr) for(auto& (v) : (arr))
#define pint(x) printf("%d\n", x);
#define pll(x) printf("%lld\n", x);
#define si(x) scanf("%d", &x);
#define sl(x) scanf("%lld", &x);
#define all(x) x.begin(), x.end()
#define fastIO ios::sync_with_stdio(0);cin.tie(0);
int main() {
fastIO;
int roads, integers;
int ite = 1;
cin >> roads >> integers;
while(roads != 0 && integers != 0){
int c = 0;
int res = 0;
int x = 0;
res = roads - integers;
// cout << "res = " << res << endl;
if(res <= 0){
cout << "0" << endl;
}else{
FOR(i,1,27){
x = integers*i;
if(x >= res){
cout << "Case " << ite << ": " << i << endl;
break;
}else if( i == 26){
cout << "Case " << ite << ": impossible" << endl;
}
else{
continue;
}
}
}
ite++;
cin >> roads >> integers;
//cout << "Lei :" << roads << " "<< integers << endl;
}
return 0;
}