Divisible by 3

AtCoder
IDabc370_g
Time4000ms
Memory256MB
Difficulty
We call a positive integer $n$ a good integer if and only if the sum of its positive divisors is divisible by $3$. You are given two positive integers $N$ and $M$. Find the number, modulo $998244353$, of length-$M$ sequences $A$ of positive integers such that the product of the elements in $A$ is a good integer not exceeding $N$. ## Constraints * $1 \leq N \leq 10^{10}$ * $1 \leq M \leq 10^5$ * $N$ and $M$ are integers. ## Input The input is given from Standard Input in the following format: $N$ $M$ [samples]
Samples
Input #1
10 1
Output #1
5

There are five sequences that satisfy the conditions:

*   $(2)$
*   $(5)$
*   $(6)$
*   $(8)$
*   $(10)$
Input #2
4 2
Output #2
2

There are two sequences that satisfy the conditions:

*   $(1, 2)$
*   $(2, 1)$
Input #3
370 907
Output #3
221764640
Input #4
10000000000 100000
Output #4
447456146
API Response (JSON)
{
  "problem": {
    "name": "Divisible by 3",
    "description": {
      "content": "We call a positive integer $n$ a good integer if and only if the sum of its positive divisors is divisible by $3$.   You are given two positive integers $N$ and $M$. Find the number, modulo $998244353",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 4000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc370_g"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "We call a positive integer $n$ a good integer if and only if the sum of its positive divisors is divisible by $3$.  \nYou are given two positive integers $N$ and $M$. Find the number, modulo $998244353...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments