A white ball and a red ball are placed on a rectangular billiard table. Before the white ball hits the red ball, it must hit the cushions (the four edges of the table) exactly $N$ times. Among all such paths, find the minimum distance that the white ball travels.
The input consists of several test cases. Each test case is a single line of seven space-separated integers.
L W CX CY TX TY N
The last line contains seven zeros and must not be processed.
For each test case, print on its own line the minimum distance the white ball travels. Round the value to three decimal places (rounding at the fourth decimal place).