Programming assignment A4M33PAL

Cable TV

A huge telephone company is planning to reuse its already installed, unused wires for a brand new cable TV channel. The company’s future income depends on three main factors:

  1. The running cost of TV channel (we denote it by R),
  2. the TV charges (we will denote it by H), which are, of course, affected by the number of units connected together in the cable TV (we denote it by U), and
  3. the cost of used connection maintenance (we denote it by M).

All units of the cable TV must be connected together. Units are connected together if there is at least one path between every two units. The path is defined as usual by a sequence of two-unit connections. Every two-unit connection is always bidirectional. Conditions of cable TV service are changing every hour due to unstable economic situation. Fortunately, the company can operate with very confidential parametric functions for forecast calculations. The income is calculated as H(U,t) - M(t) - R(t), where

For a further analysis, the management of the company wants to know the lowest time t when the planned income will cross over a defined threshold L for some positive U and thus according to connections of U units.

Input

The Input contains six lines with integers N,A,B,C,D,L.

Output

The output contains one line with the lowest t that the income is greater than L for some positive U where 0 < UN. If there is no such t from 0 to 100000, then the program will return one line with text “NO SOLUTION FOUND!”.

Examples

Input:

20
1
10000
2
9999
19

Output:

0

Input:

200
5
10
6
5
1200

Output:

426

Input:

20
4
10
6
5
200

Output:

74271

Input:

1000
5
9
6
5
5996

Output:

19