Maximize It!

  • + 1 comment

    The answer for Test Case #10 is incorrect! It is given as 763 but the maximum value actually is 766. Here is how this comes about from the data in that case. One possible grouping of numbers from the lists is:

    488512261, 2, 1, 337650738, 2, 518538304

    Squaring these gives:

    238644229147332121, 4, 1, 114008020871944644, 4, 268881972715196416

    there sum is: 621534222734473190

    Then taking the modulus with M=767: 621534222734473190 % 767 = 766

    I downloaded only this case of 4 that i supposedly got wrong. The other case which i did not check are #12, #14 and #15.