-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay88
52 lines (39 loc) · 1.27 KB
/
Day88
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
50
51
52
//A. Minimize!
//https://codeforces.com/problemset/problem/2009/A
import java.util.Scanner;
public class Minimize {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Read number of test cases
int t = scanner.nextInt();
// Process each test case
for (int i = 0; i < t; i++) {
// Read values of a and b
int a = scanner.nextInt();
int b = scanner.nextInt();
// Calculate and print the minimum value
System.out.println(b - a);
}
scanner.close();
}
}
//GameWithIntegers
import java.util.Scanner;
public class GameWithIntegers {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// Read number of test cases
int t = scanner.nextInt();
// Process each test case
for (int i = 0; i < t; i++) {
int n = scanner.nextInt();
// Determine the winner based on n % 3
if (n % 3 == 0) {
System.out.println("Second");
} else {
System.out.println("First");
}
}
scanner.close();
}
}