#P1821. Polycarp and Coins

Polycarp and Coins

题目描述

Click here to read PDF of this problem

输入格式

As shown in the PDF.

输出格式

As shown in the PDF

样例

6 
1000 
30 
1 
32 
1000000000 
5 

334 333 
10 10 
1 0 
10 11 
333333334 333333333 
1 2 

提示

Codeforces Round #734 (Div. 3) A题

Input by QLU_张席畅