fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int k, n, c, d;
  6. cin >> k;
  7. cin >> n;
  8. n = (-1)*n;
  9. k = (-1)*k;
  10. d = (n % k + k)% k;
  11. c = (n - d)/k;
  12. cout << d << " " << c << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5288KB
stdin
48
100
stdout
-4 2