## CCC '07 J3 - Deal or No Deal Calculator

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type

Deal or No Deal™ is a game show on NBC. You can click here to play it (requires Flash).

In the CCC version of the game, there are possible dollar amounts: , , , , , , , , , sealed in imaginary briefcases. These dollar amounts are numbered (i.e. , , , ..., ). Before the game starts the contestant will have chosen one of the briefcases as his/hers to possibly keep. During the game, some of the ten possible dollar amounts have been eliminated from the game because the contestant has selected some of the other briefcases and revealed the amounts inside.

At some point, the contestant will stop opening briefcases, and a "Banker" will offer the contestant cash in exchange for what might be contained in his/her chosen briefcase. Then the contestant is asked: "Deal or No Deal?".

Write a program that helps a player decide if he/she should choose "deal" or "no deal", by calculating the average of the remaining amounts (i.e., all unopened briefcases, including his/her "own" briefcase), and comparing that value to the "Banker's" offer. If the offer is higher than the average, then the player should "deal" otherwise, the player should say "no deal".

#### Input Specification

The user must input a number () which indicates how many cases have been opened so far, followed by a list of integers between and representing the values in the game that have been eliminated, followed by the "Banker's" offer. For example: 3 2 5 10 300 indicates that briefcases containing , , and have been eliminated and the Banker's offer is . You may assume that no duplicate case numbers are entered for the eliminated values, and you may assume that the "Banker's" offer is an integer greater than .

#### Output Specification

The program will print out one of two statements: deal or no deal.

#### Sample Input 1

2
3
8
198000

#### Sample Output 1

no deal

#### Sample Input 2

8
10
9
8
7
6
5
4
3
400

#### Sample Output 2

deal

CCC problem statements in large part from the PEG OJ

## Comments

• rexguan1  commented on March 2, 2018, 9:07 p.m.

the game doesn't work even if you activate adobe flash

• moladan123  commented on Dec. 4, 2014, 9:55 a.m.
Missing Link

The question says you can click here to play it, but there is no link!!! We are outraged!!! Mass hysteria!!!

• FatalEagle  commented on Dec. 4, 2014, 3:46 p.m.

Fixed.

• Dordor1218  commented on Feb. 2, 2018, 7:34 p.m.

I still can't play it!

• Xyene  commented on Feb. 2, 2018, 7:39 p.m.

The game requires Flash to run, and as such may not be playable in all browsers (notably Firefox).

• jfu0952  commented on Aug. 8, 2018, 9:16 a.m.

Worked for me (Chrome)

• Yuting9  commented on Dec. 4, 2014, 5:12 p.m.

The game works first time, but second time, it says you have chosen 6 briefcases before you do, breaking the game.

• FatalEagle  commented on Dec. 4, 2014, 6:30 p.m.

I did not make the game. Complain to the creator, whoever he may be.

• BMP  commented on Dec. 4, 2014, 3:24 p.m.

Feels.