VFDIV - Very Fast Division
Given two positive integers A and B, compute the unique Q and R such that A = Q * B + R and 0 <= R < B. That is, compute the quotient, Q, and the remainder, R, of A divided by B.
The first line contains a single integer T (1 <= T <= 10), indicating the number of test cases. Each test case contains a single line with A and B separated by a space. A and B will be positive integers with no more than 100,000 decimal digits with no leading zeroes.
For each test case output a single line containing Q and R separated by a space.
1234567890098765432112345678900987654321 98765432100123456789 Output: 12 8
Note: Submissions that are little more than using your language's built in big integer library are subject to disqualification without notice.
Also, see http://www.spoj.com/problems/VFMUL/Last edit: 2013-01-05 06:41:31
Try https://www.spoj.com/problems/FDIV/ first