Last updated
Last updated
Given 2 integers A and B and an array of integars C of size N.
Element C[i] represents length of ith board.
You have to paint all N boards [C0, C1, C2, C3 … CN-1]. There are A painters available and each of them takes B units of time to paint 1 unit
of board.
Calculate and return minimum time required to paint all boards under the constraints that any painter will only paint contiguous sections of board.
2 painters cannot share a board to paint. That is to say, a board cannot be painted partially by one painter, and partially by another.
A painter will only paint contiguous boards. Which means a configuration where painter 1 paints board 1 and 3 but not 2 is invalid.
Return the ans % 10000003
Input Format
Output Format
Constraints
For Example