Problem Statement
AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number.
Constraints
- 1 ≤ a,b ≤ 100
- a and b are integers.
Input
Input is given from Standard Input in the following format: a b
Output
If the concatenation of a and b in this order is a square number, print Yes
; otherwise, print No
.
Sample Input :1 21
Sample Output :Yes
import java.util.Scanner;
public class Main {
public static void main(String[] args){
int a,b;
int count=0;
Scanner scan=new Scanner(System.in);
a=scan.nextInt();
b=scan.nextInt();
do{
b/=10;
count++;
}while(b>0);
if(Math.sqrt((a*Math.pow(10, count))+b)%1==0){
System.out.print("Yes");
}
else{
System.out.print("No");
}
}
}