-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSPEEDTEST.cpp
More file actions
33 lines (25 loc) · 746 Bytes
/
SPEEDTEST.cpp
File metadata and controls
33 lines (25 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*Alice is driving from her home to her office which is A kilometers away and will take her X hours to reach.
Bob is driving from his home to his office which is B kilometers away and will take him Y hours to reach.
Determine who is driving faster, else, if they are both driving at the same speed print EQUAL.*/
#include <iostream>
using namespace std;
void solution (float a,float x,float b,float y){
float sa = a/x, sb = b/y;
if(sa == sb)
cout<<"Equal\n";
else if(sa>sb)
cout<<"Alice\n";
else
cout<<"Bob\n";
}
int main() {
// your code goes here
int test;
cin>>test;
while(test--){
float a,x,b,y;
cin>>a>>x>>b>>y;
solution(a,x,b,y);
}
return 0;
}