MASKS-EDITORIAL

problem link:

https://www.codechef.com/CLAG2020/problems/MASKS

Author:https://www.codechef.com/users/dhussa_09

Tester:https://www.codechef.com/users/dhussa_09

Translator:https://www.codechef.com/users/dhussa_09

Editorialist:https://www.codechef.com/users/dhussa_09

DIFFICULTY:
SIMPLE

** PREREQUISITES:**
LOGIC

PROBLEM:

The chef has received one problem but he is a bit busy in cooking so he needs you to solve it.

There isPreformatted text N number of patients standing in a queue to withdraw money from atm. There are fewer masks available in our area. we cant provide a mask to everyone in the queue. if a person is not wearing a mask there is a possibility of transferring corona-virus to the person in front of him and behind him. For eg-If the second person is wearing a mask then there is no possibility of passing any disease from First to the Second person in the queue and so on. As we don’t know who has Corona disease. we have to find the minimum number of mask required for not spreading diseases from one person to another person standing one behind others in the queue.

EXPLANATION:

The number of minimum mask required for not spreading coronavirus is n/2.
If the alternate person will wear the mask then no corona will spread from one to another.
in case, of single or no person in a queue there is no need of mask as corona cant spread to anyone further.

The solution in c++14 language:
#include
using namespace std;

int main() {
// your code goes here
int t;
cin>>t;
for(int i=0;i<t;i++)
{
long long int n,ans;
cin>>n;
ans=n/2;
cout<<ans<<endl;
}
return 0;
}