لینک‌های مفید برای شرکت در مسابقه:

در طول مسابقه، می‌توانید سؤالات خود را از قسمت «سؤال بپرسید» مطرح کنید.

!H – Fall in Love


  • محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

After a year since Erfan came back from US, he noticed that he left his heart there!!! Yes, Erfan finally fell in love. He saw Sara for the first time in Chicago last year. Now Erfan has decided to express his love and lets Sara know about his love for her (He read some psychological books and after that he made this decision). Since Sara is an intelligent girl, she has made a condition for Erfan. She asks Erfan to answer her questions. The problem is that whether n! is divisible by m or not. Help Erfan to answer these questions.

توضیح تصویر

ورودی🔗

In the First line, one integer is given - TT (the number of Sara’s questions) that 0<T<5000 \lt T \lt 500

Each of the following TT lines containing two positive integers, nn and mm, both less than 2312^{31}.

خروجی🔗

For each question, output a line stating whether n!n! is divisible by mm or not, in format shown below.

مثال‌ها🔗

ورودی نمونه ۱🔗

2
6 9
6 27
Plain text

خروجی نمونه ۱🔗

9 divides 6!
27 does not divide 6!
Plain text
ارسال پاسخ برای این سؤال
در حال حاضر شما دسترسی ندارید.