PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000187. Ba số nguyên tố
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Ba số nguyên tố
Three Consecutive Primes
Source: VNOJ olp_kc24_prime / OLP Sinh viên 2024
Version: Phuoc Hung OJ Extended (one dataset per execution; batched queries remain together).
Problem Statement
Given integers , find the largest integer whose prime factorization uses exactly three consecutive primes with positive exponents , such that the number of positive divisors of is exactly . A solution is guaranteed to exist.
Input
One line containing integers .
Output
Print the largest valid .
Subtasks
- Subtask 1 (20 points): , .
- Subtask 2 (30 points): , .
- Subtask 3 (30 points): , .
- Subtask 4 (20 points): , .
Sample Input
32 8
Sample Output
30
Sample Explanation
uses three consecutive primes and has positive divisors. No larger valid integer is at most .