C. Cave Painting

Codeforces
IDCF922C
Time1000ms
Memory256MB
Difficulty
brute forcenumber theory
English · Original
Chinese · Translation
Formal · Original
Imp is watching a documentary about cave painting. <center>![image](https://espresso.codeforces.com/8ec8a9fff94ac26b2c760e63823e96e9e224b87b.png)</center>Some numbers, carved in chaotic order, immediately attracted his attention. Imp rapidly proposed a guess that they are the remainders of division of a number _n_ by all integers _i_ from 1 to _k_. Unfortunately, there are too many integers to analyze for Imp. Imp wants you to check whether all these remainders are distinct. Formally, he wants to check, if all , 1 ≤ _i_ ≤ _k_, are distinct, i. e. there is no such pair (_i_, _j_) that: * 1 ≤ _i_ < _j_ ≤ _k_, * , where is the remainder of division _x_ by _y_. ## Input The only line contains two integers _n_, _k_ (1 ≤ _n_, _k_ ≤ 1018). ## Output Print "_Yes_", if all the remainders are distinct, and "_No_" otherwise. You can print each letter in arbitrary case (lower or upper). [samples] ## Note In the first sample remainders modulo 1 and 4 coincide.
Imp 正在观看一部关于洞穴壁画的纪录片。 一些以混乱顺序刻下的数字立即引起了他注意。Imp 快速推测这些数字是某个数 #cf_span[n] 除以从 #cf_span[1] 到 #cf_span[k] 的所有整数 #cf_span[i] 的余数。不幸的是,对于 Imp 来说,要分析的整数太多了。 Imp 希望你检查这些余数是否互不相同。形式化地说,他希望检查所有 #cf_span[1 ≤ i ≤ k] 的余数是否互不相同,即不存在一对 #cf_span[(i, j)] 满足: 输入仅包含一行,包含两个整数 #cf_span[n], #cf_span[k] #cf_span[(1 ≤ n, k ≤ 10^{18})]。 如果所有余数互不相同,则输出 "_Yes_",否则输出 "_No_"。 你可以以任意大小写形式输出每个字母。 在第一个样例中,对 #cf_span[1] 和 #cf_span[4] 取模的余数相同。 ## Input 仅一行包含两个整数 #cf_span[n], #cf_span[k] #cf_span[(1 ≤ n, k ≤ 10^{18})]。 ## Output 如果所有余数互不相同,则输出 "_Yes_",否则输出 "_No_"。你可以以任意大小写形式输出每个字母。 [samples] ## Note 在第一个样例中,对 #cf_span[1] 和 #cf_span[4] 取模的余数相同。
**Definitions** Let $ n, k \in \mathbb{Z} $ with $ 1 \leq n, k \leq 10^{18} $. Let $ R_i = n \bmod i $ for $ i \in \{1, 2, \dots, k\} $. **Objective** Determine whether all remainders $ R_1, R_2, \dots, R_k $ are distinct.
Samples
Input #1
4 4
Output #1
No
Input #2
5 3
Output #2
Yes
API Response (JSON)
{
  "problem": {
    "name": "C. Cave Painting",
    "description": {
      "content": "Imp is watching a documentary about cave painting. <center>![image](https://espresso.codeforces.com/8ec8a9fff94ac26b2c760e63823e96e9e224b87b.png)</center>Some numbers, carved in chaotic order, immedi",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF922C"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Imp is watching a documentary about cave painting.\n\n<center>![image](https://espresso.codeforces.com/8ec8a9fff94ac26b2c760e63823e96e9e224b87b.png)</center>Some numbers, carved in chaotic order, immedi...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "Imp 正在观看一部关于洞穴壁画的纪录片。\n\n一些以混乱顺序刻下的数字立即引起了他注意。Imp 快速推测这些数字是某个数 #cf_span[n] 除以从 #cf_span[1] 到 #cf_span[k] 的所有整数 #cf_span[i] 的余数。不幸的是,对于 Imp 来说,要分析的整数太多了。\n\nImp 希望你检查这些余数是否互不相同。形式化地说,他希望检查所有 #cf_span[1 ≤ i...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n, k \\in \\mathbb{Z} $ with $ 1 \\leq n, k \\leq 10^{18} $.  \nLet $ R_i = n \\bmod i $ for $ i \\in \\{1, 2, \\dots, k\\} $.\n\n**Objective**  \nDetermine whether all remainders $ R_1, R_...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments