Dev Skill DCP-33: Catch Me If You Can Solution
Problem Link
Dev Skill DCP-33: Catch Me If You Can Solution
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t,i=1;
cin>>t;
while(t--)
{
int v1,v2,d,t;
cin>>v1>>v2>>d>>t;
int s2=(v2*t);
int s1=v1*t;
s1=s1-s2;
if(s1>d || (d==0 && t>0))
cout<<"Case "<<i<<": Abir will be arrested"<<endl;
else
cout<<"Case "<<i<<": Abir will survive"<<endl;
i++;
}
return 0;
}
No comments