Painter's Partition Problem

Solve a famous interview problem based on Binary Search.

Problem statement

We have to paint n boards of length {A1{A_1} ...