fork download
  1. program download;
  2. { NOTA: si raccomanda di usare questo template anche se non lo si capisce completamente }
  3.  
  4. var
  5. C, F, N, T, nc, nf, test : LongInt;
  6.  
  7. begin
  8. {
  9.   decommenta le due righe seguenti se vuoi leggere/scrivere da file
  10.   assign(input, 'input.txt'); reset(input);
  11.   assign(output, 'output.txt'); rewrite(output);
  12. }
  13.  
  14. ReadLn(T);
  15. for test:=1 to T do begin
  16. ReadLn();
  17. ReadLn(N, F, C);
  18.  
  19. nf := 0;
  20. nc := 0;
  21.  
  22. nf:=nf + N div F;
  23. nc:= nc+ (N mod F) div C;
  24.  
  25.  
  26. Write('Case #', test, ': ');
  27. WriteLn(nf, ' ', nc);
  28. end;
  29.  
  30. end.
  31.  
Success #stdin #stdout 0.01s 5280KB
stdin
6

2308 9357 101

9431 145 1

9579 497 1

1029 9206 2561

8795 375 1548

8863 487 1
stdout
Case #1: 0 22
Case #2: 65 6
Case #3: 19 136
Case #4: 0 0
Case #5: 23 0
Case #6: 18 97