This page is still under construction.

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

Delicious Cookie

Time limit1sMemory limit512 MB

Summary
Split every piece of a right triangle with legs a and b N times along the altitude to the hypotenuse and print the natural log of the K-th largest piece area.
Level

Medium5 of 10

Topics
Combinatorics, Geometry, Math
Solved
No attempts yet

Problem

Ellie's favorite cookie is shaped like a right triangle. Its two sides other than the hypotenuse have lengths aa and bb. One day Ellie thought of a way to eat a great many of these cookies.

Drop a perpendicular from the right angle to the hypotenuse and cut along it: one cookie splits into two right triangles. The total area does not change, but young Ellie was happy just to hold two cookies instead of one. Cutting both pieces the same way gives four pieces, then eight. Starting from a single right triangle cookie and cutting every piece she owns, repeated NN times, leaves 2N2^N pieces. Ellie has already finished those NN rounds and now holds 2N2^N pieces.

She decided the pile is too large, so she will give Peter the piece whose area is the KK-th largest. Write a program that finds the area of the piece Peter receives.

Input

The first line contains four positive integers aa, bb, NN, KK, separated by single spaces. (1≤a,b≤1001 \le a, b \le 100, 1≤N≤401 \le N \le 40, 1≤K≤2N1 \le K \le 2^N)

Output

Let SS be the area of the piece Peter receives. Print ln⁡S\ln S on the first line. The area itself can be extremely small, so the natural logarithm is printed instead of the area. Round it to exactly nine digits after the decimal point, padding with zeros when a digit is missing.

Examples3

  1. Example 1

    Input
    3 4 1 1
    
    Expected output
    1.345472367
    
  2. Example 2

    Input
    3 4 1 2
    
    Expected output
    0.770108222
    
  3. Example 3

    Input
    1 1 40 1
    
    Expected output
    -28.419034403