Under construction

Still being built. Things may change

Why Hoban-woo Was Late for School 1

Interview

Time limit1sMemory limit1024 MB

Summary
Given four stats and a target N, find the fewest +1 blessings needed so the average of the four stats is at least N.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Hoban-woo, the mascot of Kyungpook National University and a thumbs-up fairy, was heading through the university's main gate on the way to class when a mysterious dimensional gate pulled him into another world.

As a god of this other world, you will help Hoban-woo defeat the Demon King, return to Earth, and get to school on time.

You are given four numbers, which are Hoban-woo's current stats: strength (STRSTR), dexterity (DEXDEX), intelligence (INTINT), and luck (LUKLUK).

Using blessings that each raise one stat by 1, find the minimum number of blessings needed to make Hoban-woo's average stat at least NN.

Input

The first line contains STRSTR, DEXDEX, INTINT, LUKLUK, and NN separated by spaces. (1≤STR,DEX,INT,LUK,N≤100)(1 \le STR, DEX, INT, LUK, N \le 100)

All input numbers are positive integers.

Output

Print the minimum number of blessings needed to make Hoban-woo's average stat at least NN.

Hint

Hoban-woo's average stat can be computed as follows.

Average stat =STR+DEX+INT+LUK4=\frac{STR+DEX+INT+LUK}{4}

Examples2

  1. Example 1

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

    Input
    7 12 4 23 11
    
    Expected output
    0