You are given two non-decreasing sequences A=(A1,A2,...,AM) and B=(B1,B2,...,BN).
You can choose any two indices i and j, and then swap Ai and Bj.
Note that the you can do the operations as many times as you want, and your goal is to transform A into an arithmetic sequence. After opeartions, you can rearrange the sequence A.
Now, determine how many distinct arithmetic sequences you can obtain.
Input Format
Output Format
Constraints
In the first case, the sequence A could be transfromed into (−1,0,1), (1,0,−1), (0,1,2) or (2,1,0) by operations.
In the second case, the sequence A could be transfromed into (1,1,1) or (0,0,0) by operations.