Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/funksiya-egizak-tub-sonlar

Is it a twin prime

Medium 2000 ms 128 MB 56%
Share

Write a function IsTwinPrime(x) that returns true if the positive integer $x$ is prime and $x - 2$ or $x + 2$ is prime as well, and false otherwise.

Example 1: IsTwinPrime(13) → true — $11$ and $13$ are primes.

Example 2: IsTwinPrime(23) → false — $23$ is prime, but neither $21$ nor $25$ is prime.

Write only the function body.

The number 13 goes into the function IsTwinPrime, which returns true

Input

One line with a positive integer $x$ — the argument of the function.

Output

The value returned by the function: true or false.

Note

$1 \le x \le 10^{5}$

Examples

Input #1
13
Output #1
true
Input #2
23
Output #2
false

Sign in to submit a solution

Signing up is free and takes a minute.