The 6th National Information Technology Competition for School Students

Problem (1): Unique set of factors

Given a positive integer number, print a unique set of the prime factors for the number. For example, the number 24 has factors: 2 X 2 X 2 X 3; hence, your program should print: 2 and 3 only.

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 aa number.

Output: For each instance of the problem given as input, display the number and its prime factors without repetition..

Sample Input / Resultant Output
3
99
24
210 / 99: 3 11
24: 2 3
210: 2 3 5 7

Problem (2): New Line

Liny is good in typing, however, after he finished typing a paragraph he found out that his new line key (Enter key) does not work. You are requested to help Liny to add a new line after each sentence. The end of a sentence is marked by a full stop, question mark, or exclamation mark.

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 paragraph(no new lines).

Output: For each instance of the problem given as input, display the paragraph by printing each sentence along its number in separate line.

Sample Input / Resultant Output
1
I’m Liny. I type very fast and you cannot compete with me. However, I got unlucky and my paragraph got corrupted because my new line key is not working! Please help Liny overcome his new line problem. Can you do so? / (1) I’m Liny.
(2) I type very fast and you cannot compete with me.
(3) However, I got unlucky and my paragraph got corrupted because my new line key is not working!
(4) Please help Liny overcome his new line problem.
(5) Can you do so?

Problem(3): Collinear Points

Given n points in 2 dimensional space, identify whether the points are collinear or not.For example, points in the left hand side of the figure below are collinear while the points in the right hand side are not.

Collinear
/ Non-Collinear

Input: The first line contains a positive integer n indicating how many instances of the problemare subsequently described. Each such instance described on a single line by 2N+1 numbers. The first number is the number of points N, and the remaining 2N numbers are the coordinates of point.

Output: For each instance of the problem given as input, display either yes if the points are collinear or not otherwise.

Sample Input / Resultant Output
2
3 1 2 3 3 5 4
3 1 1 3 3 4 3 / Yes
No

Problem (4): Polynomial Helper

Poly is a smart students who likes polynomials and their derivatives. However, from time to time he needs to take a break from the pencil and paper calculations and seek computer help to calculate the value of a function along with the value of a derivative for specific point. Can you help Poly.

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

We define "strange" numbers in the following way:1)All strange numbers have at least one prime digit 2) The total of even digits is greater than the total of odd digits.

Input: The first line contains a positive integer n indicating how many numbers to be checked whether it is strange or not. The next line contains n numbers separated by new line.

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
6
2
5
78
23
3338881
939392 / 2 isstrange
5 is Not strange
87 isstrange
23 is Not strange
3338881 is strange
939392 is Not strange