-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChiaHet.java
34 lines (32 loc) · 983 Bytes
/
ChiaHet.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package codeptit;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;
/**
*
* @author Administrator
*/
public class ChiaHet {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0){
BigInteger a = sc.nextBigInteger();
BigInteger b = sc.nextBigInteger();
if(a.divideAndRemainder(b)[1].equals(BigInteger.ZERO)
|| b.divideAndRemainder(a)[1].equals(BigInteger.ZERO)){
System.out.println("YES");
}
else
System.out.println("NO");
}
}
}