Vlada
Far far away in byteland, elections was finished. Next task is forming government. Every party reach census have some places in parliament. Government can form party alone or coalition, but in every scenario number of delegates must be over half of total delegates in parliament. CESID (what ever this means) want to know how many different ways exist to form government.
InputIn first line od standard input is positive number N, representing number of party with census (1 ≤ N ≤ 20).
In next N lines is N numbers Si, (1≤ Si ≤ 200), representing number of places in parliament for i-th party.
In next N lines is N numbers Si, (1≤ Si ≤ 200), representing number of places in parliament for i-th party.
OutputIn one and only line on standard output You need to write number of ways to form government.
Input:
Output:
4
10
20
30
40
Output:
7
Input:
Output:
2
50
51
Output:
2
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.