直接大数,编译器不能用 ,手动写完直接过
import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
BigInteger a = in.nextBigInteger();
BigInteger b = BigInteger.ONE;
int ans = 1;
while(true) {
if(b.mod(a).equals(BigInteger.ZERO)) {
System.out.println(b.divide(a) + " " + ans);
break;
}
ans++;
b = b.multiply(BigInteger.valueOf(10)).add(BigInteger.ONE);
}
}
}