HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


51124 - Easy Tiae words

Guest
• Review clarifications (1)

Section problems

• 51135 - Class Average 1
• 51136 - Class Average 2
• 51094 - Passing the course
• 51130 - Permutation of Everything
• 51069 - Last Digit of a Fibonacci Nu...
• 51073 - Campus Tours for High Sch...
• 51148 - Circles
• 51123 - Mr. Li Criteria
• 51124 - Easy Tiae words
• 51145 - Graduation Exam
• 51117 - The Most Crowded
• 51146 - Popular Baby Names
• 51131 - Running After a Thief
• 51143 - Departments Competition
• 50994 - The Most Crowded Station
• 51118 - Place 7 to the 5th position
• 51132 - Problem Solving Competition

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Easy Tiae words

Dr. Tiae has difficulty reading words with too many consonants. She likes the words with more vowels (a, e, i, o, and u). She defines the ease of a word

For example, the word "Lai" has 2 vowels and 3 letters. So, its TV is 66.667. The values closer to 0 are difficult, the values closer to 100 are easier. As another example Eyjafjallajokull is a difficult word, because it has 6 vowels with a TV 37.5.

Question: Write a program that reads a list of (n) words. Then, the program prints the top (m) easy Tiae words. If there are two words whose difficulty is similar (TV difference is less than 0.0001) show the words in alphabetical order (A is before B).
Note: If needed you can use
  bool isVowel(char ch);
function from   #include "utils/functions.h" library.

Input specification: You will be given two integers: the number of words (n), and the number of top (m) Tiae words to show. The following n lines contain a word (words contain only 26 English uppercase or lowercase letters) where 0 ≤ m ≤ n ≤ 50,000.

Output specification: Show top m easy words.

Sample Input 1 Sample Input 2
8 4
Yu
Tan
Ana
Elma
Alexander
Lorraine
Francesko
Tania
8 4
Tiziana
Oltiona
Astrit
Enisa
Gresa
Shi
Elidjona
Sabina
Sample Output 1 Sample Output 2
Ana
Tania
Elma
Lorraine
Enisa
Oltiona
Tiziana
Elidjona

Explanation: The list of Tiae words sorted according to difficulty for the sample input 1:
  Ana 66.667
  Tania 60
  Elma 50
  Lorraine 50
  Yu 50
  Alexander 44.444
  Francesko 33.333
  Tan 33.333

The words "Elma" "Lorraine" and "Yu" have the same difficulty. So, they are in alphabetical order.



Для отправки решений необходимо выполнить вход.

www.contester.ru