Problem 1012 Title: Find matrix element

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

Problem 1016 Title: Find prime numbers

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

Problem 1018 Title: Reverse string

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

Problem 1020 Title: Count dollars

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

Problem 1028 Title: Sort integers based on their greatest prime factors

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
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.