File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ ``` java
2+
3+ import java.util.* ;
4+ import java.io.* ;
5+
6+ class Main {
7+
8+ // IO field
9+ static BufferedReader br = new BufferedReader (new InputStreamReader (System . in));
10+ static BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (System . out));
11+ static StringTokenizer st = new StringTokenizer (" " );
12+
13+ static void nextLine () throws Exception {st = new StringTokenizer (br .readLine ());}
14+ static int nextInt() throws Exception {
15+ if (! st. hasMoreTokens()) nextLine();
16+ return Integer . parseInt(st. nextToken());
17+ }
18+ static long nextLong() throws Exception {
19+ if (! st. hasMoreTokens()) nextLine();
20+ return Long . parseLong(st. nextToken());
21+ }
22+ static void bwEnd() throws Exception {bw. flush();bw. close();}
23+
24+ // Additional field
25+
26+ static int T , p, q, r;
27+
28+ public static void main(String [] args) throws Exception {
29+
30+ T = nextInt();
31+ while (T -- > 0 ) {
32+
33+ ready();
34+ solve();
35+ }
36+
37+ bwEnd();
38+
39+ }
40+
41+ static void ready() throws Exception {
42+
43+ p = nextInt();
44+ q = nextInt();
45+ r = nextInt();
46+
47+ }
48+
49+ static void solve() throws Exception {
50+
51+ bw. write((Math . min(q, r) + p - 1 ) + " \n " );
52+
53+ }
54+
55+ }
56+
57+ ```
You can’t perform that action at this time.
0 commit comments