25 lines
381 B
C++
25 lines
381 B
C++
|
|
#include <bits/stdc++.h>
|
||
|
|
|
||
|
|
using namespace std;
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
int n;
|
||
|
|
cin >> n; //树的高度
|
||
|
|
|
||
|
|
int hour = 0;
|
||
|
|
int finish = 0;
|
||
|
|
//hour=1--->3
|
||
|
|
//hour=2--->3-1
|
||
|
|
|
||
|
|
//hour=3--->3-1+3
|
||
|
|
|
||
|
|
while (finish < n) {
|
||
|
|
hour++;
|
||
|
|
if (hour % 2 > 0) finish += 3;
|
||
|
|
else finish -= 1;
|
||
|
|
}
|
||
|
|
cout << hour << endl;
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|