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




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

Your feedback is our precious!

Or call +88 02 9853138 for support