CT28310

Uma and the Secret scrolls

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The accountant Uma has been asked to track down a clerical error. On the desk lies a long table of scrolls 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 <= 759; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 495 125170393 903855810 821698616 815894887 119155398 532451675 254457245 279606415 11548322 14745222 293249180 748792695 104417595 616618791 528523345 604880775 331869095 311257252 724148616 719988966 272027043 242343992 415518393 497572701 514653169 687769414 712313248 188711012 767415344 105613543 470738043 732378040 631703497 494259952 629171906 927139358 206337074 966212610 580488000 283636263 590761375 883270758 732949156 768438480 82189543 740839245 200541953 596321498 788416546 127208778 197956302 551144733 24290253 59302181 515051268 505995875 81239496 616715845 383134493 666387877 199654252 529538417 83168869 760302177 355481693 837745515 377762201 555160865 745751752 527246722 194134295 633328719 454115794 699025570 739588320 403328376 987650651 518466253 635742623 859559886 524…
Output: 990373408

Example 2:

Input: 29 423672245 884794962 75766296 849040317 285623126 140197598 615721674 296868914 50523917 873326805 763567202 512881899 468203301 352922884 225648649 98530536 977959 923457729 493638485 965962035 506558542 763403764 186423 810990416 30776075 780646958 209918501 625345695 593385915
Output: 922479770

Example 3:

Input: 618 328358083 746445846 601313650 765773665 189014651 678704461 418112579 304937134 372249957 733753023 178108460 997526409 334377630 107455918 86173641 744317678 568076006 944260007 656087662 473384638 194826275 479620776 807713610 604476685 468218317 757581566 585171403 197026027 985089199 457881346 423885657 345286224 686135568 345622617 765838823 528671034 299160762 106826236 763959856 47543628 861443876 774082820 183410561 685347821 881076104 447025304 921715943 674224831 779217683 401715021 649197006 205494357 34661854 383474435 338658869 780964479 304829747 913674315 793600021 42870676 853065229 147894787 636741711 427433682 802101844 773954558 596478464 289411043 944186125 524883421 264374369 710797344 874032309 271811494 397926617 178642420 3271455 380357640 384181129 148587791 88…
Output: 944066027

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.