#P12000. 扶苏出勤日记
扶苏出勤日记
Problem Description
Fusu is a maimai (舞萌) fan. In the next days, she will play maimai every day, and she hopes that the number of rounds she plays each day is the same.
Playing one round of maimai costs a fixed game coin. However, the price of game coins may change every day. Specifically, on day , one yuan can buy game coins.
By doing black work for Luogu, Fusu will earn some income every day. She will earn yuan on day .
Each day, Fusu will first receive that day’s income , then buy game coins, and then play maimai.
Each day, Fusu may use any amount of the money she has to buy game coins at that day’s exchange rate. That is, she does not have to exchange all her money at once: she may spend only part of her money to buy game coins on that day, and save the remaining money for buying game coins in future days. Also, she does not have to spend all her game coins in one day: she may spend only part of them that day, and save the remaining game coins to play in later days.
Fusu knows the exchange rate and her income for each of the next days. She wants to play the same number of rounds of maimai every day during these days. Therefore, she wants to know: under an optimal strategy for buying game coins, what is the maximum number of rounds she can play per day?
Input Format
This problem contains multiple test cases within a single test point. The first line contains a positive integer , the number of test cases. For each test case:
The first line contains an integer , the total number of days.
The second line contains integers , where is the number of coins that 1 yuan can buy on day .
The third line contains integers , where is Fusu’s income on day .
Output Format
For each test case, output one line with one integer, the answer.
3
5
1 2 3 4 5
5 4 3 2 1
5
1 1 1 1 1
2 3 4 5 6
9
9 9 8 2 4 4 3 5 3
10 10 10 10 10 10 10 10 10
5
2
55
Hint
Constraints
Let be the sum of over all test cases in a single test point.
- For of the data, , .
- For of the data, , .
- For of the data, , .
- Another of the data satisfies for .
- Another of the data satisfies for .
- For of the data, , , , , .
Translated by ChatGPT 5