Coins in a Line II(LintCode 395):

Problem