Help me in solving SUMKMAX problem

My issue

for test Case 3
possible permutations
(1,2,3)
(1,3,2)
(2,3,1)
(3,2,1)

so why it is showing only 2;

My code

#include <bits/stdc++.h>
using namespace std;

int mod = 1e9+7;
int main() {
	// your code goes here
    int t, n;
    vector<long long int>fact(300000);
    fact[0] = 1;
    for(long long int i =1; i<300000; i++){
        fact[i] = ((i%mod)*(fact[i-1]%mod))%mod;
    }
    cin>>t;
    while(t--){
        cin>>n;
        for(int i =1;i<=n; i++){
            cout<<(((fact[i])*(fact[n-(i-1)]))%mod)<<" ";
        }
        cout<<endl;
    }
}

Problem Link: Sum of Max K Subarray Practice Coding Problem

not all permutation will give same maximum value
1 2 3 will give 2+3=5
1 3 2 will give 3 +3 =6
2 3 1 will give 3+3=6
3 2 1 will give 3+2=5
hence ans will be 2 as there are two permutation giving maximum value