DCP-341: Square Back to All Problems

Easy Geometry > Basic Geometry


Given two points in 2d space, find the size of the largest square that can be drawn centered at those points such that, the squares do not intersect ( they may touch each other but must not intersect ) Here center of a square is the point from which every side is equidistant. Input: ------ First line will contain an integer, the number of test cases <= **10000**. Each test contains four nonnegative integer **xA, yA, xB, yB**. (xA,yA) is the co ordinate of point A and (xB,yB) is the coordinate of point B. Integers representing the coordinates will be <= **9*10^18** Output: ------- For each case print one integer, the side length of the **largest axis parallel squares centered at A and B** satisfying the property mentioned earlier. Sample Input ------------ 1 1 1 1 1 Sample Output ------------- 0


Problem Setter:

Mehdi Rahman

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 2.00
C++ 1.00
C++14 2.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

31/225

Solve/Submission

Ranking

# User Language Timing
01 mahbubcseju Cpp14 0.00s
02 Rakib_RS C 0.00s
03 I_See_You Cpp14 0.01s
04 moshiurDambi C 0.01s
05 nasif2587 Cpp14 0.01s
06 Zeronfinity Cpp14 0.01s
07 kissu_pari_na Cpp 0.01s
08 ssavi Cpp14 0.01s
09 feodorv C 0.01s
10 Morass Cpp14 0.01s
11 Robbinb1993 Cpp 0.01s
12 prateepm Cpp14 0.01s
13 tariqiitju Cpp 0.02s
14 somia Cpp 0.02s
15 showmic Cpp14 0.02s
16 joker70 Cpp14 0.02s
17 alttlprgrmmng Cpp 0.02s
18 ittehad Cpp 0.02s
19 DynamicOvi Cpp14 0.02s
20 akib9ctg Cpp 0.03s
21 dmehrab06 Cpp14 0.03s
22 rayhan50001 Cpp14 0.03s
23 hasanuzzaman333 CSharp 0.06s
24 RandyWaterhouse Python3 0.10s
25 MamunICT13 Java 0.90s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support