There is this very easy looking question. My solution works fine with tests cases on codechef compiler & g++ & codeblocks. But judge give a Runtime error every f*ing time!!! Someone please help
Question : Girls and Security Patrol
#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
class dist
{
long u=0,v=0;
double x=0;
double t=0;
public:
void entuv()
scanf("%d%d%lf",&u,&v,&x);
void calcT()
t=(double)x/(u+v);
double retT()
return t;
};
int main()
{
int n;
dist k;
double ans[100];
scanf("%d",&n);
for(int i=0; i<n ;i++)
{
k.entuv();
k.calcT();
ans[i]=k.retT();
}
for(int i=0;i<n;i++)
{
printf("%lf\n",ans[i]);
}
return 0;
}