My issue
I am getting time limit exceed
My code
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner scan=new Scanner(System.in);
int t=scan.nextInt();
for(int i=0;i<t;i++)
{
int n=scan.nextInt();
int x=scan.nextInt();
int y=n*x;
int count=0;
while(y>0)
{
n=n/10;
count++;
}
if(count==5 && y/10000!=0 )
{
System.out.println("YES");
}
else
{
System.out.println("NO");
}
}
}
}
Problem Link: SEVENRINGS Problem - CodeChef