CT583

The Largest Step Beneath Glowfen

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The quartermaster Tarun has been asked to plan the harvest festival. On the desk lies a long table of ingots readings. Task: Read n integers and print the largest absolute difference between two consecutive elements. For n=1 print 0. Input format: First line: n. Second line: n space-separated integers. Output format: Print the maximum consecutive absolute difference. Constraints: 1 <= n <= 36; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 4 257153420 970737916 592630582 777377214
Output: 713584496

Example 2:

Input: 27 959195815 832331542 528805516 973866677 607336858 371451406 188035962 407908525 108735649 92235919 33652678 658734428 783020387 205446466 418009871 35167949 194272988 475995103 520208273 497323063 236810348 94727381 4809139 912533028 703137899 957039233 85781230
Output: 907723889

Example 3:

Input: 32 100365877 784472615 868628822 799439454 765440698 301429932 149198527 417506129 46653996 849130667 773240239 859181382 915147781 884623023 883894240 114819623 585630990 463358095 996471731 131396377 533807886 694794242 839653977 328150738 634191096 826043063 97550919 415270827 883183805 811709953 956538684 948809649
Output: 865075354

Constraints:

1 <= n <= 36; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
The Largest Step Beneath Glowfen - EASY Coding Problem | CodeTikki