Home > Back-end >  Xi 'an distance
Xi 'an distance

Time:10-20


Xiao Ming came to the ancient capital of xi 'an, want to visit datang west city!

Xi 'an road can be seen as a straight line, perpendicular to the x or y axes xiao Ming is located in the (a, b), and destination located at (c, d), ask at least a few steps can reach,

Input format:
A line of four integers, a, b, c, d, said coordinates (a, b) and (c, d), and 0 here & lt;=a, b, c, d<=1000

The output format:
The output of the two points of xi 'an distance,

Input the sample:
0 0, 3, 4,
The output sample:
7

The code length limit
1 KB
Time limit
50 ms
Memory limit
64 MB

CodePudding user response:

This is not the absolute value of a - c + b - the absolute value of d

CodePudding user response:

Like this and chess grid subject
  • Related