Skip to content

Commit 9f1434c

Browse files
committed
Codeforces Round 720
1 parent c8ba93e commit 9f1434c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
}

0 commit comments

Comments
 (0)