Help me!!!
I want code...help me please!!!


Problem B: Mysterious Treasure
The planet of Nine Dragons is famous not only for its beautiful scene but also for the legend about the
secret treasures. As an astronaut, you have found an old map guiding you to the secret cave where the
treasures are hidden. Unfortunately, the door of the cave is locked and is only opened at certain times of
the day.
A day in this planet is very long as it has 10
9
minutes. The door of the cave is opened at the n
th
minutes
(from midnight) if n! = 1 ×2 ×… nis divisible by n
3
(i.e., n! mod n
3
= 0).
Given n, your task is to write a program to determine if the door of the cave is opened at the n
th
minute.
Input
The input file consists of several data sets. The first line of the input file contains the number of data
sets which is a positive integer and is not bigger than 20. The following lines describe the data sets.
Each data set consists of one line containing the integer n(1< n< 10
9
).
Output
For each data set write in one line “YES” if the door is opened at the given n
th
minute or “NO”
otherwise.
Sample Input Sample Output
2
6
12
NO
YES








Problem C: Prime Concatenation
Given two positive integers nand d, your task is to write a program to find the smallest positive integer
mwith at least 2ddigits, satisfying the following conditions:
• m≥ n
• mis a concatenation of two prime numbers, each number has at least ddigits.
For example, given d= 2, n= 1112, then the smallest mis 1113 which is the concatenation of two 2-digit primes 11 and 13.
Input
The input file consists of several data sets. The first line of the input file contains the number of data
sets which is a positive integer and is not bigger than 20. The following lines describe the data sets.
Each data set consists of one line containing two space-separated positive integers nand d(1≤ n≤ 10
9
và 1 ≤ d≤ 5).
Output
For each data set write in one line the desired number m.
Sample Input Sample Output
3
1112 2 1113
10 1 22
2011 2 2311