Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Kittipon

Problemset: Slowly Express

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-06 19:46:38

#include <bits/stdc++.h>
using namespace std;

int n, k, nn;
string a;

int main()
{

    while (1)
    {
        cin >> n;
        if(n < 0) break;
        n += nn;
        while (1)
        {
            if(n < 500){
                nn = n;
                break;  
            } 
            if (n > 800)// 1200 400
            {
                k++;
                n -= 800;
            }
            else if (n >= 500)
            {
                k++;
                n -= n;
            }
        }
        cout << k << '\n';
        k = 0;
    }
}