Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

A point in Minecraft can be represented a 3-D coordinate. Currently, Chebyshev The Creeper, Euclidean The Enderman and Manhattan The Magma Cube are having a race. Each of them want to know how long it will take them to go from the coordinates (A, B, C) to the coordinates (X, Y, Z).

Every second, Chebyshev The Creeper can change his x-coordinate by at most one, y-coordinate by at most one and z-coordinate by at most one.

Euclidean The Enderman will travel the straight line distance from (A, B, C) to (X, Y, Z) and teleports at a speed of 1 unit per second.

Every second, Manhattan The Magma Cube can hop once, which will alter either his x-coordinate by one, y-coordinate by one, or z-coordinate by one.

Input Format

The first line will contain three spaced integers representing A, B, C respectively. The second line will contain three spaced integers representing X, Y, Z respectively.

|A|, |B|, |C| \leq 10^3
|X|, |Y|, |Z| \leq 10^3

Output Format

The output should consist of exactly three lines.
The first line should contain the time it takes for Chebyshev The Creeper to finish the race.
The second line should contain the time it takes for Euclidean the Enderman to finish the race, rounded down to the closest integer.
The final line of output should contain the time it takes for Manhattan The Magma Cube to finish the race.

Sample Input

3 -2 1
4 -1 3

Sample Output



  • 2
    HARRIBO  commented on Sept. 2, 2019, 12:49 a.m.

    Can anyone help me with the creeper case?

    (aw man)

    • 0
      Tzak  commented on Sept. 2, 2019, 10:24 a.m.

      I would recommend joining the DMOJ Slack to get the answers you need quickly without cluttering up the comment stream.