출처
- 2022 서강대학교 청정수컵 새내기 Round F번
문제
풀이
#include <iostream>
using namespace std;
void solve(void) {
int n;
cin >> n;
int ans = (n/18)*2;
n %= 18;
if (n == 0) cout << ans;
else if (n < 10) cout << ans + 1;
else if (n % 2 == 0) cout << ans + 2;
else cout << ans + 3;
}
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}