-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmink.java
More file actions
45 lines (41 loc) · 1.31 KB
/
Copy pathmink.java
File metadata and controls
45 lines (41 loc) · 1.31 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
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import static java.lang.Integer.parseInt;
public class mink {
static ArrayList<Long> list1 = new ArrayList<>();
static ArrayList<Long> list2 = new ArrayList<>();
static ArrayList<Long> list3 = new ArrayList<>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String f = sc.nextLine();
int t = parseInt(f);
while(t>0) {
int k = sc.nextInt();
int n = sc.nextInt();
int m = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int x = n + m - k;
op(k, n, m, a, b, x);
System.out.println(Collections.min(list3));
list1.clear();
list2.clear();
list3.clear();
t--;
}
}
static void op(long k,long n,long m,long a,long b,long x){
for (long i = a; i <= n; i++) {
list1.add(i);
}
for (long j = b; j <= m; j++) {
list2.add(j);
}
for (long p = 0; p < list1.size(); p++) {
// for (long q = 0; q < list2.size(); q++) {
// if(list1.get(p)+list2.get(q) == x)
// list3.add(list1.get(p)*list2.get(q));
}
}
}