给出2个大整数A,B,计算A / B和A Mod B的结果。
Input
第1行:大数A 第2行:大数B (A,B的长度 <= 100000,A,B >= 0)
Output
第1行:A / B 第2行:A Mod B (A % B)
Input示例
987654321 1234
Output示例
800368 209
import java.math.BigInteger;
import java.util.Scanner;
public class Div {
private static Scanner in;
public static void main(String[] args) {
BigInteger a,b;
in=new Scanner(System.in);
while(in.hasNextBigInteger()) {
a=in.nextBigInteger();
b=in.nextBigInteger();
BigInteger c[]=a.divideAndRemainder(b);
System.out.println(c[0]);
System.out.println(c[1]);
}
}
}