CATOW - Cairo Tower

 

Arrivals of people at a telescope exhibit follow an exponential distribution of mean a
minutes. Only one person can see the exhibit at a time. Time is taken by one person to
see the exhibit follows an exponential distribution of mean s minutes. A person can
buy a ‘privilege’ ticket for L.E. 30 which gives him/her priority in the queue over those
who don’t have a privilege ticket. 50% of the visitors are willing to pay and get a
privilege ticket, but they make their decision to do so only if one or more people are
in the queue when they arrive (another person is waiting to be served). The exhibit is
open continuously from 10 am to 4 pm (last arriving visitor will arrive before 4 pm,
visitors in the queue will be served even after 4 pm).
Simulate n replications of the operation of the system, each replication has a length of
one complete day and report the following statistics:
1. Profit gained through the sale of privilege tickets
2. Average waiting time of an exhibit visitor
3. Average waiting time of an exhibit visitor with a privilege ticket
4. Average waiting time of an exhibit visitor without a privilege ticket
Your simulator should take as input (keyboard input) n, s and a and should report the
required statistics (averaged across all n replications).
n can take large values like (10000, 100000 ... etc ).
The model is to be coded in C/C++/C#/Python or Java. No bonus will be given for
certain language.

Arrivals of people at a telescope exhibit follow an exponential distribution of mean (a) minutes. Only one person can see the exhibit at a time. Time is taken by one person to see the exhibit follows an exponential distribution of mean (s) minutes. A person can buy a ‘privilege’ ticket for L.E. 30 which gives him/her priority in the queue over those who don’t have a privilege ticket. 50% of the visitors are willing to pay and get a privilege ticket, but they make their decision to do so only if one or more people are in the queue when they arrive (another person is waiting to be served). The exhibit is open continuously from 10 am to 4 pm (last arriving visitor will arrive before 4 pm, visitors in the queue will be served even after 4 pm). Simulate n replications of the operation of the system, each replication has a length of one complete day and report the following statistics:

1. Profit gained through the sale of privilege tickets

2. Average waiting time of an exhibit visitor

3. Average waiting time of an exhibit visitor with a privilege ticket

4. Average waiting time of an exhibit visitor without a privilege ticket

Your simulator should take as input (keyboard input) n, s and a and should report the required statistics (averaged across all n replications). n can take large values like (10000, 100000 ... etc ).

 

The model is to be coded in C/C++/C#/Python or Java. No bonus will be given for a certain language.

 

Input

three numbers n,s,a

Output

three numbers (one per line) represents Av. waiting for all, Av. waiting for privilege and Av. waiting for without-privilege. rounded to the nearest ten.

Example

Input:
1000
2
1
Output:
180
20
340

Added by:mohamed adel
Date:2018-10-15
Time limit:5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.