P26374 [AtCoder] Popular Vote Game
提高-
题目描述

Problem Description

In a certain country, the "Fox Party" and the "Rabbit Party" are competing for popularity. As a strategist for the "Fox Party", you are thinking of ways to win the upcoming popularity vote.

This country has $ N $ regions, and voting takes place in each region. Given the total number of votes and the number of votes received by the "Fox Party" in each region, create a program to determine the number of regions where the "Fox Party" has secured a majority of the votes.

Note that "majority" refers to more than half, so for example, if the total number of votes is $ 100 $, receiving $ 50 $ votes does not constitute a majority.

Input Format

The input is given from the standard input in the following format:

$ N $ $ V_1 $ $ V_2 $ ... $ V_N $ $ F_1 $ $ F_2 $ ... $ F_N $

  • The first line contains an integer $ N $ ($1\ ≦\ N\ ≦\ 100$), which represents the number of regions.
  • The second line contains $ N $ integers separated by spaces. The $ i $th ($1\ ≦\ i\ ≦\ N$) number $ V_i $ ($1\ ≦\ V_i\ ≦\ 1,000$) represents the total number of votes in the $ i $th region.
  • The third line contains $ N $ integers separated by spaces. The $ i $th ($1\ ≦\ i\ ≦\ N$) number $ F_i $ ($0\ ≦\ F_i\ ≦\ V_i$) represents the number of votes received by the "Fox Party" in the $ i $th region.

Output Format

Output the number of regions where the "Fox Party" has secured a majority of the votes in one line.

Ensure a newline at the end of the output.

Sample Input and Output

Sample Input #1

5
150 130 100 200 150
100 60 50 101 70

Sample Output #1

2

Sample Input #2

5
5 4 3 2 1
2 2 2 1 0

Sample Output #2

1

Notes/Hints

Sample Explanation 1

The "Fox Party" has secured a majority in the 1st and 4th regions, so output $ 2 $. Note that in the 3rd region, the "Fox Party" has exactly half of the total votes, which does not constitute a majority.

Sample Explanation 2

Only in the 3rd region has the "Fox Party" secured a majority of the votes.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5 150 130 100 200 150 100 60 50 101 70
样例输出
2