Problem (1): Vowel Reduction

It is very well known that a person can read easily a sentence after removing all the vowels from it. Try by yourself for example the sentence “IT-Mrthn s fn” and you will discover that the sentence is “IT-Marathon is fun”. Your job is to write a program to remove all lower case vowels from a sentence.

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance is described on a single line by a paragraph.

Output: For each instance of the problem given as input, display the paragraph correctly by removing all lower case vowels from the sentence.

Sample input: Resultant output:

------

3IT-Mrthn s Fn.

IT-Marathon is Fun.Thss thvwlrdctnprblm.

This is the vowel reduction problem.Y r cmptngwthprd.

You are competing with pride.

Problem (2): One Space

Spacy is good in typing, however, he has problem in holding the space bar longer than enough. This results in a more than one space between words. Your task is to help Spacy to reduce multiple spaces in a paragraph into one space.

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance is described on a single line by a paragraph. Notice that in the example below, spaces are represented by ‘-‘ to show number of spaces in the sentence.

Output: For each instance of the problem given as input, display the paragraph correctly by removing the multiple spaces.

Sample input: Resultant output:

------

3Spacy is a very fast typist.

Spacy---is—a-very----fast-----typist-.ITMarathon is wonderful and nice.

ITMarathon-is--wonderful-and--nice.Have fun.

Have-fun------.

Problem(3): Inside Rectangle Points

Given two points in 2 dimensional space representing the upper left and lower right corners of a rectangle, write a program to determine whether a point is inside, on, or outside the rectangle.For example, given the rectangle below identified by (x1,y1) and (x2,y2), p1 is inside the rectangle, p2 is outside the rectangle, and p3 is on the rectangle.

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance is described on a single line by 6 integersrepresenting 2 points. The first two are the upper left and lower right corners of the rectangle. The third point is the point we want to check whether it is inside, on, outside the rectangle.

Output: For each instance of the problem given as input, display on a single line the words inside, on, or outside.

Sample input: Resultant output:

------

5inside

0 4 8 2 3 3on

0 4 8 2 4 4outside

0 4 8 2 2 1on

1 4 3-1 1 3inside

1 4 3-1 2 0

Problem (4): Is Sorted

Given a sequence of numbers, determine if the numbers are sorted in ascending order or not.

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance is described on a single line by a sequence of numbers space separated. The first number of the sequence is the length of the sequence

Output: For each instance of the problem given as input, display on a single line the words Sorted or Not Sorted.

Sample input: Resultant output:

------

5Sorted

5 4 8 12 33 33Sorted

3 44 8 Not Sorted

6 4 8 12 12 1120Not Sorted

5 44 1311 10 3Sorted

1 4

Problem (5): Strange Numbers

A strange number is a number that is greater than 9 and its digits product is divisible by its digits sum. For example, 123 is a strange number because (1*2*3) / (1+2+3) =6/6=1, while 23 is not a strange number because (2*3)/(2+3)=6/5=1.2 (not an integer). Given a number M, identify whether M is strange or not.

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance is described on a single line by a number M.

Output: For each instance of the problem given as input, display on a single line the words Strange or Not Strange.

Sample input: Resultant output:

------

4Not Strange

1234Strange

246Not Strange

635Not Strange

9

Problem (6): Even Numbers

Given a two positive integers, s and p wheres < p, write a program that displays on the screen all positive even integers thatlie in the range of integers from the smaller to the larger. If one (orboth) of the input integers are also even, they must be included in theoutput.

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance is described on a single line by two numbers s and p.

Output: For each instance of the problem given as input, the sequence of even numbers lying between s and p as described above.

Sample input: Resultant output:

------

22 4 6 8 10 12 14 16 18 20

2 2014 16 18 20 22 24 26 28 30 32 34 36 38 40

13 41

IT Marathon Contest 2012 ProgrammingPage 1