You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <iostream>
|
|
using namespace std;
|
|
int main() {
|
|
int n, cnt = 0;
|
|
cin >> n;
|
|
cnt = n / 3;
|
|
if (n == 2)
|
|
cnt = -1;
|
|
else if (n == 4)
|
|
cnt = 4;
|
|
else if (n % 3 == 1)
|
|
cnt += 1;
|
|
else if (n % 3 == 2)
|
|
cnt += 2;
|
|
|
|
cout << cnt << endl;
|
|
return 0;
|
|
} |