This page is still under construction.

Parts of this page are still being built. What you see may change.

Reading numbers in 0.1 seconds

Time limit0.1sMemory limit512 MB

Summary
Read up to five million natural numbers within 0.1 seconds and print how many were read and their sum.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Read as many numbers as possible within 0.1 seconds. Read every natural number in the input, then print how many you read and their sum. Reading one line at a time with a slow routine misses the time limit, so pick the fastest input method your language provides.

Input

The first line contains the count of numbers NN. (1≤N≤5 000 0001 \le N \le 5\,000\,000)

Each of the next NN lines contains one natural number. Every number given is at most 10 000 00010\,000\,000.

Output

Print the count MM of natural numbers you read on the first line, and their sum on the second line. The sum can exceed the range of a 32-bit integer.

Examples6

  1. Example 1

    Input
    5
    1
    2
    3
    4
    5
    
    Expected output
    5
    15
    
  2. Example 2

    Input
    1
    1
    
    Expected output
    1
    1
    
  3. Example 3

    Input
    1
    10000000
    
    Expected output
    1
    10000000
    
  4. Example 4

    Input
    3
    7
    7
    7
    
    Expected output
    3
    21
    
  5. Example 5

    Input
    10
    10000000
    10000000
    10000000
    10000000
    10000000
    10000000
    10000000
    10000000
    10000000
    10000000
    
    Expected output
    10
    100000000
    
  6. Example 6

    Input
    100
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    
    Expected output
    100
    5050