Turbulent time come decide buy sugar advance there n shop sell sugar ith shop sell pack sugar a_i coin pack customer day so order buy pack need visit shopsanother problem price increase day day cost a_i second day cost a_i 1 day a_i 2 shop ion contrary everyday budget x coin in word day buy pack possible total cost exceeding x note do not spend coin day can not use coin dayseventually cost pack exceed x will not able buy single pack so pack able buy till moment total