Under construction

Still being built. Things may change

Laptop

Time limit2sMemory limit1024 MB

Summary
Given the times when a laptop switches between mains and battery, find the battery charge percentage at 23:59, with full charge taking y minutes and full drain taking x minutes.
Level

Easy2 of 10

Topics
Simulation, Implementation
Solved
No attempts yet

Statement

Не было печали, апдейтов накачали.

Интернет-фольклор

Vova recently bought a new laptop. After buying it, he installed his favorite operating system, winBSD, and ran it without interruption for several weeks as an experiment.

During that time Vova found that on battery power the laptop is fully drained after xx minutes of continuous operation of the system. winBSD consumes the same amount of battery energy per unit of running time, no matter which tasks it performs.

When the laptop runs on mains power, the battery is fully charged in yy minutes (with the system running). Likewise, the battery gains the same amount of charge per unit of winBSD running time.

Vova moves around the city often, so the laptop switches its power source (from mains to battery and back) nn times during the day. At the start of the day (00:00) the laptop runs on mains power and the battery is fully charged.

After a winBSD update, the battery charge indicator stopped working. Write a program that takes the schedule of power source switches and determines the battery charge at the end of the day.

Input

The first line contains the integers nn, xx, and yy (0≤n≤200 \le n \le 20, 1≤x,y≤15001 \le x, y \le 1500). Each of the next nn lines contains a time of day in the format hh:mm when the power source was switched. The times are between 00:01 and 23:58, are given in chronological order, and are pairwise distinct.

Output

Print the battery charge percentage at 23:59 with an accuracy of at least three decimal places.

Examples3

  1. Example 1

    Input
    1 200 120
    00:01
    
    Expected output
    0
    
  2. Example 2

    Input
    2 200 120
    00:01
    22:59
    
    Expected output
    50.0
    
  3. Example 3

    Input
    7 300 317
    01:43
    03:54
    05:29
    08:29
    14:48
    16:47
    23:08
    
    Expected output
    83.0