-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathChocolate Feast
More file actions
44 lines (35 loc) · 768 Bytes
/
Copy pathChocolate Feast
File metadata and controls
44 lines (35 loc) · 768 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
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int t;
scanf("%d",&t);
for(int a0 = 0; a0 < t; a0++){
int n;
int c;
int m;
scanf("%d %d %d",&n,&c,&m);
int chocs,wraps,final;
chocs = n/c;
wraps =chocs;
final = chocs;
while(1)
{
if(wraps- m >=0)
{
final = final+1;
wraps= wraps-m +1;
}
if(wraps-m <0)
{
break;
}
}
printf("%d\n",final);
}
return 0;
}