{"ScriptPreparationCode":"var x1 = 10;\r\nvar y1 = 20;\r\nvar x2 = -10;\r\nvar y2 = -20;\r\n\r\nfunction euclidian_a() {\r\n\treturn Math.sqrt(x1 * x2 \u002B y1 * y2);\r\n}\r\n\r\nfunction euclidian_b() {\r\n\treturn x1 * x2 \u002B y1 * y2;\r\n}\r\n\r\nfunction manhattan_a() {\r\n\treturn Math.abs(x1 - x2) \u002B Math.abs(y1 - y2);\r\n}\r\n\r\nfunction manhattan_b() {\r\n\tif (x1 \u003C 0) {\r\n\t\tx1 *= -1;\r\n\t}\r\n \tif (x2 \u003C 0) {\r\n\t\tx1 *= -1;\r\n\t}\r\n \tif (x1 \u003C 0) {\r\n\t\tx1 *= -1;\r\n\t}\r\n\tif (y2 \u003C 0) {\r\n\t\ty1 *= -1;\r\n\t}\r\n\treturn x1 - x2 \u002B y1 - y2;\r\n}\r\n\r\nfunction custom_a() {\r\n x1 = (x1 \u003E= 0) ? x1 : -x1 ;\r\n x2 = (x2 \u003E= 0) ? x2 : -x2 ;\r\n y1 = (y1 \u003E= 0) ? y1 : -y1 ;\r\n y2 = (y2 \u003E= 0) ? y2 : -y2 ;\r\n return x1 - x2 \u002B y1 - y2;\r\n}","TestCases":[{"Name":"Euclidian A","Code":"euclidian_a();","IsDeferred":false},{"Name":"Euclidian B","Code":"euclidian_b();","IsDeferred":false},{"Name":"Manhattan A","Code":"manhattan_a();","IsDeferred":false},{"Name":"Manhattan B","Code":"manhattan_b();","IsDeferred":false},{"Name":"Custom A","Code":"custom_a();","IsDeferred":false}]}