0% found this document useful (0 votes)
36 views1 page

Problem - 2093C - Codeforces

Uploaded by

Yhlas Yklymow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

Problem - 2093C - Codeforces

Uploaded by

Yhlas Yklymow
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

9/2/25, 10:26 AM Problem - 2093C - Codeforces

|
stdfloat | Logout

HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN

PROBLEMS SUBMIT STATUS STANDINGS CUSTOM TEST

Codeforces Round 1016 (Div. 3)


C. Simple Repetition Finished
time limit per test: 1 second Practice
memory limit per test: 256 megabytes

Pasha loves prime numbers∗ ! Once again, in his attempts to find a new way to generate prime numbers, he
became interested in an algorithm he found on the internet:
→ Virtual participation 
To obtain a new number y, repeat k times the decimal representation of the number x (without leading zeros).
Virtual contest is a way to take part in past contest,
as close as possible to participation on time. It is
For example, for x = 52 and k = 3 , we get y = 525252 , and for x = 6 and k = 7 , we get y = 6666666 . supported only ICPC mode for virtual contests. If
you've seen these problems, a virtual contest is not
for you - solve these problems in the archive. If you
Pasha really wants the resulting number y to be prime, but he doesn't yet know how to check the primality of just want to solve some problem from a contest, a
numbers generated by this algorithm. Help Pasha and tell him whether y is prime! virtual contest is not for you - solve this problem in
the archive. Never use someone else's code, read
the tutorials or communicate with other person

An integer x is considered prime if it has exactly 2 distinct divisors: 1 and x. For example, 13 is prime because it has only 2 divisors: during a virtual contest.
1 and 13 . Note that the number 1 is not prime, as it has only one divisor.
Start virtual contest
Input
Each test consists of several sets of input data. The first line contains a single integer t (1 ≤ t ≤ 100 ) — the
number of sets of input data. The following lines describe the sets of input data.
→ Clone Contest to Mashup 
The first and only line of each data set contains two integers: x and k (1 ≤ x ≤ 10
9
,1 ≤ k ≤ 7 ).
→ Submit?
Output
For each set of input data, output «YES» (without quotes) if the resulting number y will be prime, and «NO»
Language: GNU G++20 13.2 (64 bit, winlibs)
otherwise.
Choose
You may output «Yes» and «No» in any case (for example, the strings «yES», «yes», and «Yes» will be Choose File No file chosen
file:
recognized as positive answers).
Submit
Example
input Copy
→ Contest materials
4
52 3
6 7 Announcement
7 1
Tutorial
1 7

output Copy

NO → CF GetRating
NO
YES *1000
NO
Show All Tags

Contest Standings

Codeforces (c) Copyright 2010-2025 Mike Mirzayanov


The only programming contests Web 2.0 platform
Server time: Sep/02/2025 10:24:40UTC+5 (h1).
Desktop version, switch to mobile version.
Privacy Policy | Terms and Conditions

Supported by

https://codeforces.com/problemset/problem/2093/C 1/1

You might also like