Description
Input a positive integer n. Then input a nxn matrix. Find the matrix element with the largest absolute value. Output this element's original value (not the absolute value) and its position.
Input
n nxn matrix
Output
element_value row_position column_position
Sample Input
2
1 2
3 100
Sample Output
100 2 2
Description
Print all prime numbers <=N.
Input
N
Output
Prime numbers in [2,N]
Sample Input
100
Sample Output
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
Description
Reverse a string. The length of the string is at most 100.
Input
One string (letters and spaces)
Output
Reversed string
Sample Input
I am a student
Sample Output
tneduts a ma I
Description
Count the number of $ in the input. Output the result.
Input
many characters
Output
number of $
Sample Input
as$dfkjhkjkjdhf asdfkj$lskdfj werijweirjo$wie
Sample Output
3
Description
An integer's greatest prime factor is the largest prime integer that divides it. For example, 3's greatest prime factor is 3; 12's greatest prime factor is also 3; 10's greatest prime factor is 5.
Input 10 integers (all should be greater than or equal to 2). Sort these 10 integers based on their greatest prime factors, in ascending order. If two integers share the same greatest prime factor, then we break ties based on the values of these two integers (smallest first). For example, 27 and 9 share the same greatest prime factor 3. In the sorted list, 9 should be placed before 27 (because 9 is less than 27).
Input
10 integers (all >= 2)
Output
Sorted list
Sample Input
27 9 27 26 8 22 10 7 3 17
Sample Output
8 3 9 27 27 10 7 22 26 17