PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000052. Bi-shoe và Phi-shoe (Bi-shoe and Phi-shoe)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Bi-shoe và Phi-shoe (Bi-shoe and Phi-shoe)
Bi-shoe and Phi-shoe
Source: LightOJ
Version: Phuoc Hung OJ Extended
Problem Statement
There are students, and student has lucky number . Student must receive one bamboo pole of positive integer length . The pole's score is , the number of positive integers less than that are coprime to . Require . One unit of pole length costs one Xukha. Minimize the sum of costs of all poles.
Input
The first line contains . The second line contains integers , in student order.
Output
Print the minimum total cost as an integer, followed by a space and the word Xukha.
Subtasks
- Subtask 1 (20 points): ; for all .
- Subtask 2 (30 points): ; for all .
- Subtask 3 (50 points): ; for all .
Examples
Input
3
1 2 4
Output
10 Xukha
Explanation
For lucky number , choose length with . For lucky number , choose length with . For lucky number , choose length with . The total length is , so print 10 Xukha.