TouchStone
  Please Login
Login Sign Up
 Homepage  Problem Set  Examinations  Submissions  Discussions  Statistics
  • Home
  • Problem Set
  • P4462
  • Problem
  • P4462All Kill
    Limits : Time Limit : 4000 MS   Memory Limit : 565536 KB
    Description

    Input Format

    The first line contains a positive integer T(1≤T≤5), denoting the number of test cases.
    For each test case:
    The first line contains a positive integer n(1≤n≤2×10^5).
    The second line contains n nonnegative integers x1...n(0≤xi<32677).

    Output Format

    For each test case:
    A single line contains a nonnegative integer, denoting the answer.

    Sample Input

    2
    1
    1
    5
    1 2 3 4 5

    Sample Output

    1
    1087


    Source  2017 Multi7 杭州二中