fork(1) download
  1. import java.math.BigInteger;
  2. import java.io.*;
  3. import java.util.StringTokenizer;
  4. class Main
  5. {
  6. public static void main(String[] args)
  7. {
  8. String s;
  9.  
  10. int tc;
  11. try{
  12. s=stdin.readLine();
  13. tc=Integer.parseInt(s);
  14. for(int i = 0; i < tc; i++)
  15. {
  16. BigInteger n,c,d,ans,a,b;
  17.  
  18. s=stdin.readLine();
  19. st=new StringTokenizer(s);
  20.  
  21. a = new BigInteger(st.nextToken());
  22. b = new BigInteger(st.nextToken());
  23. c = a.divide(b);
  24. d = a.mod(b);
  25. System.out.println(c+" "+d );
  26. }
  27.  
  28. }
  29. catch(IOException e){};
  30. }
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
Success #stdin #stdout 0.09s 380544KB
stdin
3
128 10
4320 321
12345678900987654321123456789009876543219876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789987654321001234567899876543210012345678998765432100123456789 98765432100123456789
stdout
12 8
13 147
124999998870781250018323632788128186768222918754903267991608478265952421847247699264875553071120403710660053866537418851406368603538775571134714278762288750788662154597578304914504192815973034317182854596420429152157174056442121239704708687708589384659397957282243482338007303881924169183219750755387478351572560587508408483170897397539308293529903470235973458985658016926631400361845678187702554104021334470456198203964332454296943433323509934459429607455237754651966494033338790028707710520484497715544888363719268946499433157124314478355834228084910106555128725379332969988098747163853556135111636714631049209960717939616968313231069852242465804096044514762799936443617757229325730115143060699400349345442998886955837601608771359067002045156128496225990381426793593901327228672449027736395173094772299060448513481871854091436865222099035305986232620194065826702924991075042280137713940422960039255613295532560237632958522969229830512247979279231580981987386388298932684580996194378911661751898796348221511704014803022393316154089010287259625079803080147170272133259170169841748118180499037806968021699457366394186722445161260110487906641157000617454641179551784565804847005637571153108514906333885154404518449936485813569724717568943811249032641259047537035508342660097176022201196227453476429125039556186815375483728476038723772100594958173557302370257854727883168813328289526208907064279986821225401499064473079479288687209019536829952 74339317607010512661