CT27496

The Largest Step of the Dusky parcels

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the ivy courts of Vineward, someone must restore an old family record. This year the task falls to Minstrel, armed only with the parcels register. 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 <= 962; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 290 33365575 378419948 455582470 311101580 274546070 638235409 826020419 648207745 690820538 676777307 188634961 773625805 254839533 991158974 558297847 522700379 77574826 515184748 875318743 821267095 955663183 186821401 905600905 349774 92389339 536114763 322931386 561278849 975977930 569117162 536384808 975212960 703618348 776595411 79152003 743426010 1490132 226035814 98037613 376634549 701537500 487882524 313949553 94909718 640102070 650347810 878175333 298834475 685284699 50529760 680164674 773860788 182321032 585296003 977240651 808695368 649453355 20208970 974285756 42278031 111134908 13556077 157402958 168102598 957859137 980264688 354989884 545789573 923319547 15919987 439747448 929236769 625221843 349019458 224006288 453880582 241884244 747212247 22094257 396573923 394050796 895…
Output: 979948111

Example 2:

Input: 517 146478203 274145033 34744290 762992314 100980025 301633020 404053084 656113018 128708121 288116617 675759073 969184232 32359595 177775065 995049117 574361511 212964069 13883101 755212038 814823326 336569943 612688842 19913452 68904985 303408342 896450058 716544099 533932452 925224136 618181040 848277142 634513722 652262885 973049928 810712639 55433030 730629955 582277884 398645652 12660270 464871454 16049160 876808786 870793544 645409549 229102935 48835980 559248483 790628341 726548715 444468226 506860886 921132101 861388839 741442979 946702074 402938722 713519050 321704241 900797749 384939721 129001866 5205063 939237952 300768857 885675988 675742055 620824717 915304623 126786829 235092618 450769402 286538990 381254354 788252335 497804273 217806451 2527009 69092803 343490847 348901868 …
Output: 936824637

Example 3:

Input: 628 787435038 401246088 47177474 909946252 133720469 388467880 340613327 327642985 617273364 447273774 14347530 121897210 478763024 106314758 789218414 6188898 814061453 725886608 90684260 173586834 434002253 965769726 503474162 7889675 710933618 670627860 914547671 45360392 51373802 955295409 860366836 742910674 21306107 255593838 479765165 158725855 86946914 176054487 978604247 850124173 79429143 399186753 946183512 580708626 727659665 305653942 824387938 925806186 341529189 238250033 420722833 974305309 243731575 131105851 480945554 869478846 493509537 310835233 533969065 595092228 648735503 105301869 736046074 44327467 846488853 155443727 368402230 274315742 206343203 546594524 653499421 637110834 21833552 196638174 447819866 442700954 796453637 211064780 284174069 112208124 151431874 …
Output: 968000181

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Largest Step of the Dusky parcels - EASY Coding Problem | CodeTikki