Submission

Status:

--P-----P--P----P---

Subtask/Task Score:

20/100

Score: 20

User: Kittipon

Problemset: Slowly Express

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-06 18:48:54

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

int n, k;
string a;

int32_t main()
{

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