TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

A cellular network is a radio network made up of a number of cells each served by a base station located in
the cell. The base station receives call signals from mobile users (mobiles) in the cell it serves, which then
connects the calls to the wired land-line telephone network. When a call is requested to connect to a mobile,
the cellular network must know in which cell the mobile is located so that the call is routed to the base station
of the cell appropriately.


Mobiles move from once cell to another in a cellular network. Whenever a mobile reports its new cell as it
crosses boundaries of cells, the cellular network would know its exact cell at any time and finding (paging)
the mobile becomes a trivial task. But it is usually infeasible for a mobile to report its new location each time
it enters a new cell because of the insufficiencies of resources such as the radio bandwidth. But normally at
the time of a call arrival, the cellular network knows a limited number of cells where the mobile is located. In
this situation, a lot of paging strategies are developed to locate a mobile efficiently. The ultimate goal of
paging strategies is to minimize both the time delay and cost of paging until the mobile is found.


Now we define our problem formally. The location area is the set of n cells C = {c1, c2, …, cn} such that the
mobile is guaranteed to be in one of these cells at the time of a call arrival. Suppose that it is possible to page
any subset of these n cells in a unit of time (paging rounds) and find out if the mobile is located in one of the
cells paged. The fastest strategy to find the cell where the mobile is located is to page all the n cells in the first
and only round. However this strategy uses a lot of wireless bandwidth.


In many cases, the cellular network knows about the whereabouts of the mobile. This knowledge can be
modeled with n probability values, where the probability of the mobile being present in a cell can be estimated
for each of these n cells at the time of a call arrival. Let pi be the probability that the mobile is located at the
cell ci and all the probabilities are independent. A sequential paging strategy is to page the cells sequentially
in n paging rounds terminating once the mobile is found. Then the average cost of paging (number of cells
paged), bar(C), and the average paging delay (number of paging rounds) in locating the mobile, bar(D), can be
expressed as follows:




Input Format

Output Format

Sample Input 1

2 
5 2 
30 5 10 30 25 
5 5 
30 5 10 30 25 

Sample Output 1

3.2000
2.3000

Hints

Problem Source

Migrated from old NTUJ.

2009Seoul

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 200