Pabon_SEC

Numerical surprises

Feb 17th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.51 KB | None | 0 0
  1. import java.math.BigInteger;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String [] args)
  7.     {
  8.         int test,i;
  9.         BigInteger a,b,result;
  10.      
  11.         Scanner sc = new Scanner(System.in);
  12.         test = sc.nextInt();
  13.      
  14.         for(i=1; i<=test ;i++)
  15.         {
  16.             a=sc.nextBigInteger();
  17.             b=sc.nextBigInteger();
  18.          
  19.             result = b.remainder(a);
  20.          
  21.             System.out.println(""+result);
  22.         }
  23.      
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment