forked from BitsPleaseMSI/BitsPlease-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12.cpp
More file actions
23 lines (23 loc) · 660 Bytes
/
Copy path12.cpp
File metadata and controls
23 lines (23 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<iostream>
using namespace std;
int main()
{
int test_cases,step_covered,step_req,order_no;
cin>>test_cases;
while(test_cases)
{
order_no=0;
step_covered=0;
cin>>step_req;
do
{
order_no+=1;
if(order_no%2==0) step_covered-=3;
if(order_no%2!=0) step_covered+=5;
}
while(step_covered<=step_req);
cout<<order_no<<endl;
test_cases--;
}
return 0;
}