Help me in solving PMD7 problem

My issue

mere code m kya diikt h

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 sc=new Scanner(System.in);
		int T=sc.nextInt();
		while(T-->0){
		    Long N=sc.nextLong();
    		int B=sc.nextInt();
    		long rev=0;
    		while (N>0){
    		    long rem=N%10;
    		    long pow=(long)(Math.pow(rem,B)%10);
    		    rev=pow+rev*10;
    		    N/=10;
    		}
    		if(rev%7==0){
    		    System.out.println("YES");
    		}else{
    		    System.out.println("NO");
    		}
    		
		}
	}
}

Problem Link: CodeChef: Practical coding for everyone