2017 Winter Waterloo Local ACM Contest, Problem C
The harmonic mean of a sequence of positive integers
Vera classifies an array of positive integers
A permutation
Permutation
Given integers
If no such permutation exists, output 0
.
Constraints
are integers
Input Specification
The input will be in the format:
Output Specification
Output one line with the desired permutation. If such permutation does not exist, output one line with 0
.
Sample Input 1
Copy
3 2
Sample Output 1
Copy
2 3 1
Sample Input 2
Copy
4 1
Sample Output 2
Copy
0
Comments