PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000118. Chọn số nguyên tố để tổng không nguyên tố (Factorise N+M)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Chọn số nguyên tố để tổng không nguyên tố (Factorise N+M)
Factorise N+M
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given a prime number , find a prime number with such that is not prime.
A prime is an integer greater than with exactly two positive divisors. Any valid is accepted, and a solution is guaranteed to exist.
Input
One line containing the prime integer .
Output
Print a prime satisfying such that is composite.
Subtasks
- Subtask 1 (20 points): is prime; ; .
- Subtask 2 (30 points): is prime; ; .
- Subtask 3 (50 points): is prime; ; .
Examples
Input
7
Output
7
Explanation
The input is prime. Choose , which is prime and within the allowed range. Then is composite, so printing 7 is valid.