fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int n,k;
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12. int main(){
  13. // freopen("input.txt", "r", stdin);
  14. // freopen("output.txt", "w", stdout);
  15.  
  16. cin >> n >> k;
  17.  
  18. int a = k/n;
  19.  
  20. int b = k%n;
  21.  
  22. int c;
  23.  
  24. if (b==0) {c=b;}
  25.  
  26. else {c=n-b;};
  27.  
  28. cout << a <<" "<< b<<" "<< c << endl;
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0s 544KB
stdin
 7 30
stdout
4 2 5