-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mosquito.java
46 lines (33 loc) · 1.15 KB
/
Mosquito.java
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
import java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;
public class Mosquito {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String input = sc.nextLine();
int m, p, l, e, r, s, n;
while(!input.equals(""))
{
Scanner lineSC = new Scanner(input);
m =lineSC.nextInt();
p = lineSC.nextInt();
l = lineSC.nextInt();
e = lineSC.nextInt();
r = lineSC.nextInt();
s = lineSC.nextInt();
n = lineSC.nextInt();
for(int i = 0; i < n; i++)
{
int tempM, tempP, tempL;
tempL = e*m;
tempP = l/r;
tempM = p/s;
m = tempM;
l = tempL;
p = tempP;
}
System.out.println(m);
input = sc.nextLine();
}
}
}