File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
codeforces/Codeforces Round #720 (Div. 2) Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ package codeforces ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+
7
+ public class Nastia {
8
+ public static void main (String [] args ) throws IOException {
9
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
10
+ int t = Integer .parseInt (br .readLine ());
11
+ while (t --!=0 ){
12
+ String line = br .readLine ();
13
+ String [] temp = line .trim ().split ("\\ s+" );
14
+ long a =Long .parseLong (temp [0 ]);
15
+ long b =Long .parseLong (temp [1 ]);
16
+ if (a ==1 && b ==1 ) System .out .println ("NO" );
17
+ else if (a ==b && a !=1 ){
18
+ System .out .println ("YES" );
19
+ System .out .println (a +" " +(2 *a *b -b )+" " +2 *a *b );
20
+ }
21
+ else if (a ==1 ){
22
+ System .out .println ("YES" );
23
+ System .out .println (a +" " +(2 *b -a )+" " +2 *a *b );
24
+ }
25
+ else if (b ==1 ) System .out .println ("NO" );
26
+ else if (a >b ){
27
+ System .out .println ("YES" );
28
+ System .out .println (a +" " +(2 *a *b -a )+" " +2 *a *b );
29
+ }
30
+ else if (b >a ){
31
+ System .out .println ("YES" );
32
+ System .out .println (a +" " +(a *b -a )+" " +a *b );
33
+ }
34
+
35
+ }
36
+ br .close ();
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments