Code showing error while running in submission


sir this is my code it is running correctly in the CB IDE
but in the submission, it is showing compilation error

i have tried a lot of refresh .it hasn’t solve the problem

/bin/run.sh: line 4: 17 Segmentation fault (core dumped) ./exe

now its accepting my ans but showing all answer as wrong but custom test case and already given test case are working correct if i provide them by myself

@pankajsingh use long long int in your code as sum and mini[i]*p[i] may exceed int limit.

done, but it didn’t help . getting all test case as wrong

read carefully what i told you, sum and mina[i] * p[i] exceed int limit but you only use long long for sum, calculate your sum as this sum=sum+(long long)mina[i]*p[i];

sir now showing time limit exceeded

@pankajsingh i have updated your code look here https://ide.codingblocks.com/s/248580