Simple combinatorial problem, disordered pair

topic description

Mathematical Combinatorial problems

sources of topics and their own ideas

competitive programs

what result do you expect? What is the error message actually seen?

I tried a way to solve this problem in O (n). But get the wrong answer.

I use 2n! / (n! * 2 ^ n)

obviously, everyone wants the ability of their teammates to be as high as possible. We call a team scheme (that is, two unordered binary
groups) legal if and only if there are no two teams (A, B) and (C, D) satisfying SD > SB and SA > SC. In this
situation, An and D will want to form a team.
request how many legitimate team plans are available. As the answer may be large, please output the result of modularization of 1000000000007.
input format
the first line of input contains an integer T that represents the number of groups of test data. Then there is the T-group data.
the first row of each set of data contains an integer N. The second line contains N integers S1, S2,. . . , SN .
output format
for each set of data, output a line containing an integer that represents the result of the number of legal schemes modularized to 1000,000,007.
data range
1 T 1000
2 N 10 5
N is even

N 10 6
1 Si 10 6
sample data
enter
2
4
1 7 38
4
23 22

Aug.23,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9b59c-1850.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9b59c-1850.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?