АвтоАвтоматизацияАрхитектураАстрономияАудитБиологияБухгалтерияВоенное делоГенетикаГеографияГеологияГосударствоДомДругоеЖурналистика и СМИИзобретательствоИностранные языкиИнформатикаИскусствоИсторияКомпьютерыКулинарияКультураЛексикологияЛитератураЛогикаМаркетингМатематикаМашиностроениеМедицинаМенеджментМеталлы и СваркаМеханикаМузыкаНаселениеОбразованиеОхрана безопасности жизниОхрана ТрудаПедагогикаПолитикаПравоПриборостроениеПрограммированиеПроизводствоПромышленностьПсихологияРадиоРегилияСвязьСоциологияСпортСтандартизацияСтроительствоТехнологииТорговляТуризмФизикаФизиологияФилософияФинансыХимияХозяйствоЦеннообразованиеЧерчениеЭкологияЭконометрикаЭкономикаЭлектроникаЮриспунденкция

Description

Читайте также:
  1. Description of the sample
  2. EXERCISE 18. Match the meaning of the Latin roots with the description of their lexical meanings.
  3. Job Description
  4. Look at the Landing card in activity 10 and complete the description below.
  5. Which description correctly defines a converged network?
  6. Write the description, in two paragraphs, according to the situation below.

Input file: movies.in

Output file: movies.out

Time Limit: 1 second

Memory Limit: 128M byte

 

Description

A favorite pastime for big families in Acmestan is going to the movies. It is quite common to see a number of these multi-generation families going together to watch a movie. Movie theaters in Acmestan have two types of tickets: A single ticket is for exactly one person while a family ticket allows a parent and their children to enter the theater. Needless to say, a family ticket is always priced higher than a single ticket, sometimes as high as five times the price of a single ticket. It is quite challenging for families to decide which ticket arrangement is most economical to buy. For example, the family depicted in the figure on has four ticket arrangements to choose from: Seven single tickets; Two family tickets; One family ticket (for 0, 1, 2) plus four single tickets for the rest; Or, one family ticket (for 1 and his four children) plus single tickets for the remaining two.

Write a program to determine which ticket arrangement has the least price.

 


1 | 2 | 3 |

Поиск по сайту:



Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Студалл.Орг (0.003 сек.)