Skip to main content

Posts

Vaccine Distribution Codechef December Long challenge solution 2020

 Vaccine Distribution  Codechef December Long challenge solution 2020- This Problem vaccine distribution is taken from December long challenge 2020. lets read problem statement. Problem statement- Finally, a COVID vaccine is out on the market and the Chefland government has asked you to form a plan to distribute it to the public as soon as possible. There are a total of  N N  people with ages  a 1 , a 2 , … , a N a 1 , a 2 , … , a N . There is only one hospital where vaccination is done and it is only possible to vaccinate up to  D D  people per day. Anyone whose age is  ≥ 80 ≥ 80  or  ≤ 9 ≤ 9  is considered to be  at risk . On each day, you may not vaccinate both a person who is at risk and a person who is not at risk. Find the smallest number of days needed to vaccinate everyone. Input The first line of the input contains a single integer  T T  denoting the number of test cases. The description of  T T  test cases follows. The first line of each test case contains two space-separ

Vaccine Production December Long challenge Problem Solution

 Problem Statement- This problem is taken from codechef December long challenge.Let's read Problems statement. Increasing COVID cases have created panic amongst the people of Chefland, so the government is starting to push for production of a vaccine. It has to report to the media about the exact date when vaccines will be available. There are two companies which are producing vaccines for COVID. Company A starts producing vaccines on day  D 1 D 1  and it can produce  V 1 V 1  vaccines per day. Company B starts producing vaccines on day  D 2 D 2  and it can produce  V 2 V 2  vaccines per day. Currently, we are on day  1 1 . We need a total of  P P  vaccines. How many days are required to produce enough vaccines? Formally, find the smallest integer  d d  such that we have enough vaccines at the end of the day  d d . Input The first and only line of the input contains five space-separated integers  D 1 D 1 ,  V 1 V 1 ,  D 2 D 2 ,  V 2 V 2  and  P P . Output Print a single line co