Unable To Understand The Question And Input Format

Please help me to understand the question and its input format.

@zanj0
Sample Input:
2
2
5
1 10
Sample Output:
50

The boards are given with size :
Board 1 - Size 1
Board 2 - Size 10

Each board can only be painted by a single painter. That is , if Painter X starts painting Board 2 ( of size 10) , only X can paint on it and no other painter is allowed to help him out. So he will take the full time of 50 hrs to paint it ( as in this sample input , time taken by a single painter to paint one unit of board is 5 and this board is of size 10 , so Painter X takes 50 units of time )

While another painter , say Painter Y can finish painting Board 1 in 5 units of time.
Since both can start working simultaneously, the entire job will be done in 50 units of time.
Total time taken = 50 units

I suggest you to solve the Painter Partition Problem before solving Painter Problem as Painter Problem is just a tiny modification to Painter Partition Problem.
Painter Partition Problem - https://hack.codingblocks.com/contests/c/133/716

Let me know if you need any further help regarding this problem.

1 Like

Solved. Thanks! :smiley: