Coins in a Line III(LintCode 396):

Problem