wrong ans in INSQ17E

maths

#1

i’m getting wrong ans due to some modular problem but my formula is correct .please help me out.

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

#define LL unsigned long long

LL M = 1e9+7;
int main(){
#ifndef ONLINE_JUDGE
freopen(“input.in”,“r”,stdin);
freopen(“output.out”,“w”,stdout);
#endif

int t;
cin>>t;

while(t--){
	LL m;
	cin>>m;

	if(m<=3){cout<<"0"<<endl;}
	//cout<<(m%M)<<" ";
	LL a = m%M;
	a = (a*((m-1)%M))%M;
	a = (a*((m-2)%M))%M;
	a = (a*((m-3)%M))%M;
	a = (a*125000001)%M;
	cout<<a<<endl;
}	
return 0;

}


#2

The error is in this line: if(m<=3){cout<<“0”<<endl;}
You have to write continue otherwise it will print two lines when m<=3.


#3

oops!!!
my bad.