Under construction

Still being built. Things may change

Radio Receiver

Interview

Time limit5sMemory limit512 MB

Summary
Find the smallest radius D that lets a person moving at speed one stay within D of each broadcast at its sending time.
Level

Medium6 of 10

Topics
Binary search, Intervals, Sorting
Solved
No attempts yet

Problem

You have a radio receiver and want to receive NN messages. Each message is sent at a fixed time, measured in seconds, from a fixed position, measured in meters from the origin. You stand on a line, so your position is a single real number. You receive a message if, at the moment it is sent, the distance between you and its sending position is at most DD meters. DD is a nonnegative real number.

You choose your starting position freely and you move at a speed of at most one meter per second. Receiving a message takes no time. Find the smallest DD that lets you receive every message.

Input

The first line contains the number of test cases, CC.

The first line of each test case contains the number of messages, NN. Each of the next NN lines contains two integers PP and TT separated by one space. PP is the position the message is sent from and TT is the time it is sent. Within one test case all sending times are distinct.

Limits

  • 1≤C≤1001 \le C \le 100
  • 1≤N≤10001 \le N \le 1000
  • 0≤P≤1090 \le P \le 10^9
  • 0≤T≤1090 \le T \le 10^9

Output

For each test case, print one line in the form Case #x: D, where xx is the test case number starting at 1 and DD is the smallest DD that receives every message.

The answer is always a multiple of 0.50.5, so print exactly one digit after the decimal point. An answer of 6 is written 6.0 and an answer of 1.5 is written 1.5.

Note

In the first test case of the first example, D=6D = 6 is enough. Start at position 13 at time 2 and receive the message sent from 7. Walk right and arrive at position 14 at time 3 to receive the message sent from 20. Then walk left and arrive at position 6 at time 11 to receive the message sent from 0.

Examples2

  1. Example 1

    Input
    3
    3
    7 2
    20 3
    0 11
    2
    6 5
    6 3
    4
    5 3
    2 1
    9 4
    7 2
    
    Expected output
    Case #1: 6.0
    Case #2: 0.0
    Case #3: 2.0
    
  2. Example 2

    Input
    1
    3
    0 0
    10 1
    20 2
    
    Expected output
    Case #1: 9.0