-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathD_SoftDrinking.java
More file actions
48 lines (37 loc) · 1.08 KB
/
D_SoftDrinking.java
File metadata and controls
48 lines (37 loc) · 1.08 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
import java.util.Scanner;
public class D_SoftDrinking {
public static void main(String[] args) {
int friendn;
int bottle;
int amount;
int limes;
int slices;
int salt;
int mlPToast;
int saltPToast;
int mlToast;
int sliceToast;
int saltToast;
int toast;
Scanner input = new Scanner(System.in);
friendn= input.nextInt();
bottle= input.nextInt();
amount= input.nextInt();
limes= input.nextInt();
slices= input.nextInt();
salt= input.nextInt();
mlPToast= input.nextInt();
saltPToast= input.nextInt();
mlToast = (bottle*amount)/mlPToast;
sliceToast = limes*slices;
saltToast = salt / saltPToast;
toast = minimum(mlToast,sliceToast,saltToast);
System.out.println(toast/friendn);
input.close();
}
public static int minimum(int A, int B , int C){
if (A<B && A<C)return A;
else if(B<A && B<C)return B;
else return C;
}
}