Average and Median

Interview

Time limit1sMemory limit128 MB

Summary
Read five natural numbers and print their average and median.
Level

Easy1 of 10

Topics
Sorting, Array, Math
Solved
No attempts yet

Problem

The average is the sum of the given numbers divided by how many numbers there are. The median is the value in the middle after the numbers are sorted in increasing order.

Given five natural numbers, write a program that prints their average and median.

Input

Five natural numbers are given, one per line, from the first line through the fifth line. Each number is a multiple of 10 and is less than 100.

Output

Print the average on the first line and the median on the second line. Both values are natural numbers.

Examples1

  1. Example 1

    Input
    10
    40
    30
    60
    30
    
    Expected output
    34
    30