RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
R03556

S2. Pretty Average Primes

Unrated 레이팅 미적용
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

For various given positive integers \(N > 3\), find two primes, \(A\) and
\(B\) such that \(N\) is the average (mean) of \(A\) and \(B\). That is, \(N\) should be equal to \((A+B)/2\).

Recall that a prime number is an integer \(P > 1\) which is only divisible by 1 and
\(P\). For example, \(2,\ 3,\ 5,\ 7,\ 11\) are the first few
primes, and \(4, 6, 8, 9\) are not
prime numbers.

Possible Output for Sample Input

3 13
5 3
7 7
13 29

Footnote

You may have heard about Goldbach’s conjecture,
which states that every even integer greater than 2 can be expressed as
the sum of two prime numbers. There is no known proof, yet, so if you
want to be famous, prove that conjecture (after you finish the CCC).

This problem can be used to help verify that conjecture, since every
even integer can be written as \(2N\),
and your task is to find two primes \(A\) and \(B\) such that \(2N = A+B\).

제약

\(N > 3\)
\(P > 1\)
\((1 \le T \le 1000)\)
\((4 \le N_i \le 1\ 000\ 000, 1 \le i \le T)\)
\(N_i < 1\ 000\)

입력 형식

The first line of input is the number \(T\) \((1 \le T \le 1000)\), which is the number of test cases. Each of the next
\(T\) lines contain one integer \(N_i\) \((4 \le N_i \le 1\ 000\ 000, 1 \le i \le T)\).

For 6 of the available 15 marks, all \(N_i < 1\ 000\).

출력 형식

The output will consist of \(T\) lines.
The \(i\)th line of output will contain
two integers, \(A_i\) and \(B_i\), separated by one space. It should be
the case that \(N_i = (A_i+B_i)/2\) and
that \(A_i\) and \(B_i\) are prime numbers.

If there are more than one possible \(A_i\) and \(B_i\) for a particular \(N_i\), output any such pair. The order of
the pair \(A_i\) and \(B_i\) does not matter.

It will be the case that there will always be at least one set of
values \(A_i\) and \(B_i\) for any given \(N_i\).

예제 1
입력
4
8
4
7
21
출력
3 13
3 5
3 11
5 37
문제 정보

생성자가 기록되지 않았습니다.

출처 CCC 2019 Senior

평가 및 의견

S2. Pretty Average Primes

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

S2. Pretty Average Primes

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8