#SP0000038. Phân tích mã bí mật (Code Refactoring)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Phân tích mã bí mật (Code Refactoring)
Code Refactoring
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Alicia and Bobby use a positive integer as a secret encryption code. Yvette can break it by expressing the same as a product of two integers greater than in two different ways.
Find four pairwise distinct integers , all greater than , such that . A solution is guaranteed to exist. Any valid answer is accepted.
Input
One line containing ; at least two factor pairs satisfying the requirements are guaranteed to exist.
Output
Print exactly one line in the form Case #1: K = A * B = C * D, where are pairwise distinct. Use the literal * and = symbols.
Subtasks
- Subtask 1 (20 points): ; bảo đảm tồn tại đôi một khác nhau với .
- Subtask 2 (30 points): ; bảo đảm tồn tại đôi một khác nhau với .
- Subtask 3 (50 points): ; bảo đảm tồn tại đôi một khác nhau với .
Examples
Input
120
Output
Case #1: 120 = 2 * 60 = 3 * 40
Explanation
The two products and both equal . The factors are all greater than and pairwise distinct.
Input
210
Output
Case #1: 210 = 2 * 105 = 3 * 70
Explanation
Both and , and the four integers are pairwise distinct, so this output is valid.