NTH1  Nobabs Treasure Hunt
All of us love treasures, right? That's why young nobab Ashrafuddowla searching for a Treasure Island. And one day he find a 2d grid Treasure Island, but here is one problem. The problem is that if any one wants to find the Treasure, at first he/she solve a riddle. The riddle is “To get something, you have to give something”. Nobab Ashrafuddowla know well that only one person can solve this riddle and he is shahsufiAppleMahmud. That’s what he think sufiapple solved this riddle and said that if any one wants to find that Treasure for each move he/she will spend 1 taka. That mean if you are in place (x,y) in the grid you will pay 1 taka for (x,y+1) or (x,y1) or (x+1,y) or (x1,y) each move. Thats not enough, sufiapple also said that only that person can open the treasure who spend least taka for finding Treasure. Now nobab very worried about Treasure and decide that who can help him to find that Treasure will awarded by one AC(accepted).
You have a good chance of being rewarded. So help nobab to finding Treasure .
Input
First line contains four positive integers (x,y) and (t1,t2) where (x,y) is the position of you in 2d grid and (t1,t2) is the position of Treasure .
note that diagonal moves are not possible .
Constraints
 1000000 ≤ (x,y) ≤ 1000000
 1000000 ≤ (t1,t2) ≤ 1000000
Output
Print the only integer which is the minimum cost to find Treasure.
Example
Input: 0 0 2 0 Output: 2
hide comments
trhgquan:
20200402 01:46:00
This should be moved to tutorial. 

Scape:
20200317 22:20:14
Move to tutorial please Last edit: 20200317 22:20:24 
Added by:  asif 
Date:  20200228 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 