fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. long long int count=0,n,i=0,m;
  6. cin>>m;
  7. n = m/2;
  8. while(1)
  9. {
  10. if(n-n/10<=10)
  11. break;
  12. count += n/10;
  13. n -= n/10;
  14. i++;
  15. }
  16. cout<<i<<" "<<count;
  17. return 0;
  18. }
Success #stdin #stdout 0s 4448KB
stdin
68
stdout
14 23