Problem Discussion: VNFAR (Dream in code 2.0)


#1

This solution was showing wrong answer.What is error?
https://www.codechef.com/DRI22019/problems/VNFAR

#include <stdio.h>
int main(void) {
int T;
unsigned long long int s,l1,l2,p,ans;
scanf("%d",&T);
for(int i=0;i<T;i++)
{
scanf("%d%d%d",&s,&l1,&l2);
scanf("%d",&p);
ans=p*(l1+l2)*s;
ans=ans/l2;
printf("%d\n",ans);
}
return 0;
}


#2

ans overflows

xxxxxxxxxxxxxxxxxxxxx


#3

Why?Unsigned long long can store upto 10^18.
Then what should I do