#P3545. [POI 2012] HUR-Warehouse Store
[POI 2012] HUR-Warehouse Store
Description
There are days. On the morning of day , items arrive. At noon of day , a customer wants to buy items; you may either fulfill the customer's request or ignore it.
To fulfill the customer's request, you must have enough inventory. What is the maximum number of days whose customer requests can be fulfilled?
Input Format
The first line contains an integer , the number of days.
The second line contains integers , where is the number of items arriving on the morning of day .
The third line contains integers , where is the number of items a customer wants to buy at noon of day .
Output Format
The first line contains a single integer: the maximum number of days whose customer requests can be fulfilled.
The second line outputs one such set of days that achieves the maximum. If there are multiple solutions, output any one of them.
6
2 2 1 2 1 0
1 2 2 3 4 4
3
1 2 4
Hint
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号