A factory has N Product Quality Analysts (PQA) working in a single line. The first PQA is standing at the start of the product line and the N° PQA is standing at the end of the product line. The first PQA starts the checking of a product and takes t, minutes and then hands it over to the 2PQA More formally, the IPQA takes t, minutes time to check a product and then hand it over to the (i+1) PQA When, the N" PQA completes his inspection for a product, we call the product a "Verified Product". In this problem, you have to calculate how much time it requires to verify the first K products. For example, Let there be 4 PQAS working in the factory and they take 2, 3, 1, and 4 minutes time respectively to check a product Product checking timeline these PQA is as follows: Product 1 Product 2 Product Start of checking End of checking Start of checking End of checking By PQA, By PQA, By PQA, By PQA, 1 3 6 7 2 5 6 10 6 11 14 3 8 9 So, the first product will be verified at the end of 10 minutes, and the second product will be verified at the end of 14 minutes. Input Input starts with an integer T(15 T 51001) denoting the number of test cases. Each of the test cases starts with two integers N (1 S N s 20) and K (1 5 Ks 10%). The next line of the test case will contain N space-separated integers t, ...L (1 51510). Output The output should be in the format "Case X: Y' where X is the case number and Y is the time when the K product will be verified. Please see the output in the sample case for more clarity. Sample Input Output for Sample Input

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
J
A factory has N Product Quality Analysts (PQA) working in a single line. The first PQA is standing at the
start of the product line and the N PQA is standing at the end of the product line. The first PQA starts the
checking of a product and takes t, minutes and then hands it over to the 2nd PQA.
More formally, the IPQA takes t, minutes time to check a product and then hand it over to the (i+1) PQA.
When, the N™ PQA completes his inspection for a product, we call the product a "Verified Product".
In this problem, you have to calculate how much time it requires to verify the first K products.
For example, Let there be 4 PQAS working in the factory and they take 2, 3, 1, and 4 minutes time
respectively to check a product. Product checking timeline these PQA is as follows:
Product
1st Product
Problem J
Product Quality Analyst
2nd Product
Start of checking
End of checking
Start of checking
End of checking
By PQA, By PQA, By PQA, By PQA,
1
3
7
2
5
3
4
6
8
6
6
9
9
10
11
14
Bangakk
Ast
ef
Pr
Satters
So, the first product will be verified at the end of 10 minutes, and the second product will be verified at the
end of 14 minutes.
Output for Sample Input
Case 1: 14
Case 2: 23
Input
Input starts with an integer T(1≤ T ≤1001) denoting the number of test cases. Each of the test cases starts
with two integers N (1 ≤ Ns 20) and K (1 ≤ K≤ 10¹9). The next line of the test case will contain
space-separated integers t₁, ... (1410)
Output
The output should be in the format "Case X: Y' where X is the case number and Y is the time when the
K™ product will be verified. Please see the output in the sample case for more clarity.
Sample Input
Transcribed Image Text:J A factory has N Product Quality Analysts (PQA) working in a single line. The first PQA is standing at the start of the product line and the N PQA is standing at the end of the product line. The first PQA starts the checking of a product and takes t, minutes and then hands it over to the 2nd PQA. More formally, the IPQA takes t, minutes time to check a product and then hand it over to the (i+1) PQA. When, the N™ PQA completes his inspection for a product, we call the product a "Verified Product". In this problem, you have to calculate how much time it requires to verify the first K products. For example, Let there be 4 PQAS working in the factory and they take 2, 3, 1, and 4 minutes time respectively to check a product. Product checking timeline these PQA is as follows: Product 1st Product Problem J Product Quality Analyst 2nd Product Start of checking End of checking Start of checking End of checking By PQA, By PQA, By PQA, By PQA, 1 3 7 2 5 3 4 6 8 6 6 9 9 10 11 14 Bangakk Ast ef Pr Satters So, the first product will be verified at the end of 10 minutes, and the second product will be verified at the end of 14 minutes. Output for Sample Input Case 1: 14 Case 2: 23 Input Input starts with an integer T(1≤ T ≤1001) denoting the number of test cases. Each of the test cases starts with two integers N (1 ≤ Ns 20) and K (1 ≤ K≤ 10¹9). The next line of the test case will contain space-separated integers t₁, ... (1410) Output The output should be in the format "Case X: Y' where X is the case number and Y is the time when the K™ product will be verified. Please see the output in the sample case for more clarity. Sample Input
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY