143632025-01-10 17:26:14JoKoBoJárdakövezés (75 pont)cpp17Accepted 75/751ms508 KiB
#include<bits/stdc++.h>
using namespace std;

int main() {
    int n = 0;
    cin >> n;
    int two = 0;
    int three = 0;
    while(n > 0) {
        if (n == 4) {
            n -= 4;
            two += 2;
        } else {
            if(n%3 == 0) {
                three++;
                n -= 3;
            } else {
                two++;
                n -= 2;
            }
        }
    }
    cout << two << " " << three;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted3/31ms316 KiB
6Accepted3/31ms316 KiB
7Accepted3/31ms508 KiB
8Accepted4/41ms508 KiB
9Accepted4/41ms336 KiB
10Accepted4/41ms316 KiB
11Accepted4/41ms316 KiB
12Accepted4/41ms316 KiB
13Accepted4/41ms316 KiB
14Accepted4/41ms316 KiB
15Accepted4/41ms316 KiB
16Accepted4/41ms316 KiB
17Accepted4/41ms316 KiB
18Accepted4/41ms320 KiB
19Accepted4/41ms316 KiB
20Accepted4/41ms316 KiB
21Accepted4/41ms316 KiB
22Accepted4/41ms316 KiB