Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigInteger;
- import java.util.Scanner;
- public class Main {
- public static void main(String [] args)
- {
- int test,i;
- BigInteger a,b,result;
- Scanner sc = new Scanner(System.in);
- test = sc.nextInt();
- for(i=1; i<=test ;i++)
- {
- a=sc.nextBigInteger();
- b=sc.nextBigInteger();
- result = b.remainder(a);
- System.out.println(""+result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment