Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 7.00

large quantity of goods

A large quantity of goods are being produced by the factory every day. Consider the carrier machine of the factory which is used to transport the finished products from the workshop to the dispatch centre.

 

Finished products are kept on the carrier machine from one end, the machine takes the products to the dispatch centre, and the products are taken out at the dispatch center.

 

The machine can take n products in t minutes and return in t minutes. m products arrive at the terminal by a given schedule. What is the earliest time that all the products can be transported to the center? What is the minimum number of trips that the operator must make to deliver all products by that time?

 

 

Input

 

The first line of input contains c, the number of test cases. Each test case begins with n, t, m. m lines follow, each giving the arrival time for a product (in minutes since the beginning of the day). The operator can run the machine whenever he or she wishes, but can take only the products that have arrived up to that time.

 

Output

 

For each test case, output a single line with two integers: the time, in minutes since the beginning of the day, when the last product is delivered to the other side of the river, and the minimum number of trips made by the machine to carry the products within that time.

 

You may assume that 0

 

Example

Input: 2 2 10 10 0 10 20 30 40 50 60 70 80 90 2 10 3 10 30 40 Output: 100 5 50 2

Answers

(5)
Status NEW Posted 17 Sep 2017 05:09 AM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)