输入样例:
3
92 5 233
输出样例:
3 25392
1 25
No
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
String[] arr = br.readLine().split(" ");
boolean t = true;
for (int i = 0; i < n; i++) {
int len = arr[i].length();
for (int j = 1; j < 10; j++) {
String a = (int)(Math.pow(Integer.parseInt(arr[i]), 2)*j)+"";
//System.out.println(a);
if(Integer.parseInt(a.substring(a.length()-len,a.length()))==Integer.parseInt(arr[i])){
System.out.println(j+" "+a);
t=false;
break;
}
}
if(t) {
System.out.println("No");
}else {
t=true;
}
}
}
}