{"id":"f153a7c8-77a6-4247-a3d2-23bf7d6f2c1b","name":"Restorer Distance","description":"<a href=\"https://codeforces.com/contest/1355/problem/E\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"> Link -> Restorer Distance</i></a>","inputFormat":"Check the Link","outputFormat":"Check the Link","constraints":"Check the Link","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.*;\r\n\r\npublic class Main {\r\n public static void main(String[] args) throws Exception{\r\n Scanner sc = new Scanner(System.in);\r\n\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"3 1 100 100\r\n1 3 8\r\n","sampleOutput":"12\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"ccdbbb91-d392-43f3-8065-0ecd4a077535","name":"Ternary Search For Experts","slug":"ternary-search-for-experts-998","type":0},{"id":"49acd347-f8c9-4b41-aed4-0db4e68c2e69","name":"Restorer Distance","slug":"restorer-distance","type":1}],"next":{"id":"c39df45b-832e-45ac-8ea9-8d37bb47e30c","name":"Trick Or Treat","type":1,"slug":"trick-or-treat"},"prev":{"id":"047baf95-7756-4124-a99f-5338166fdf81","name":"Closest Distance","type":1,"slug":"closest-distance"}}}

Restorer Distance

<a href="https://codeforces.com/contest/1355/problem/E" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Restorer Distance</i></a>

{"id":"f153a7c8-77a6-4247-a3d2-23bf7d6f2c1b","name":"Restorer Distance","description":"<a href=\"https://codeforces.com/contest/1355/problem/E\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"> Link -> Restorer Distance</i></a>","inputFormat":"Check the Link","outputFormat":"Check the Link","constraints":"Check the Link","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.*;\r\n\r\npublic class Main {\r\n public static void main(String[] args) throws Exception{\r\n Scanner sc = new Scanner(System.in);\r\n\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"3 1 100 100\r\n1 3 8\r\n","sampleOutput":"12\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"ccdbbb91-d392-43f3-8065-0ecd4a077535","name":"Ternary Search For Experts","slug":"ternary-search-for-experts-998","type":0},{"id":"49acd347-f8c9-4b41-aed4-0db4e68c2e69","name":"Restorer Distance","slug":"restorer-distance","type":1}],"next":{"id":"c39df45b-832e-45ac-8ea9-8d37bb47e30c","name":"Trick Or Treat","type":1,"slug":"trick-or-treat"},"prev":{"id":"047baf95-7756-4124-a99f-5338166fdf81","name":"Closest Distance","type":1,"slug":"closest-distance"}}}
plane

Editor


Loading...

Restorer Distance

medium

Constraints

Check the Link

Format

Input

Check the Link

Output

Check the Link

Example

Sample Input

3 1 100 100 1 3 8

Sample Output

12

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode