Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To enhance data security and prevent data breaches, Uber does not store the distance and time of a ride directly. Instead, we store derived values

To enhance data security and prevent data breaches, Uber does not store the distance and time of a ride directly. Instead, we store derived values as unitless quantities: uSpeed => Value representing avg speed (Floor in case of non-int)
uAlpha => A value representing time plus distance
uBeta => A value representing time multiplied by distance
uDelta => A value representing time minus distance
Due to a technical issue, these values got mixed up, and the system forgot which value corresponds to which statistic. The values do not always appear in a specific order.
Your task is to return the distance and time corresponding
to the four given values. Assume the absolute value of
distance is always greater than time.
For example, if Time is 10 and Distance is 12.
uSpeed = Floor(12/10)1 uAlpha =12+10=22 uBeta 12*10=120 uDelta 10-12=-2
Input record can be [-2,1,22,120]
[execution time limit]0.5 seconds (cpp)
[memory limit]1 GB
[input] integer t
The first line contains an integer T, the number of test cases.
1<= T <=100000
[input] array.array.integer testCases
Each test case consists of four integers A,B,C,D representing the mixed-up values of uSpeed, uAlpha, uBeta and uDelta.
-10^9<= A,B,C,D <=10^9
[output] array.array.integer
For each test case, return two numbers, Distance followed by Time
If no such integers exist, return -1,-1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions

Question

(b) The graph of y=g(x) is shown. Draw the graph of y=g 8 (2x).

Answered: 1 week ago