B. Sum

Codeforces
IDCF10054B
Time2000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Write a program to compute the following sum S given a positive integer n: , where is the largest integer not greater than x. The input file consists of several datasets. The first line of the input file contains the number of datasets which is a positive integer and is not greater than 30. The following lines describe the datasets. Each dataset contains a positive integer n (n ≤ 1012) written on a separate line. For each dataset, write in one line the remainder of the computed sum S divided by 106. ## Input The input file consists of several datasets. The first line of the input file contains the number of datasets which is a positive integer and is not greater than 30. The following lines describe the datasets.Each dataset contains a positive integer n (n ≤ 1012) written on a separate line. ## Output For each dataset, write in one line the remainder of the computed sum S divided by 106. [samples]
**Definitions** Let $ t \in \mathbb{Z} $ be the number of datasets. Let $ D = \{n_k \mid k \in \{1, \dots, t\}\} $ be the set of inputs, where each $ n_k \in \mathbb{Z}^+ $ and $ n_k \leq 10^{12} $. **Objective** For each $ n_k $, compute: $$ S_k = \sum_{i=1}^{n_k} \left\lfloor \frac{n_k}{i} \right\rfloor $$ Output $ S_k \bmod 10^6 $.
API Response (JSON)
{
  "problem": {
    "name": "B. Sum",
    "description": {
      "content": "Write a program to compute the following sum S given a positive integer n: , where  is the largest integer not greater than x. The input file consists of several datasets. The first line of the inpu",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10054B"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Write a program to compute the following sum S given a positive integer n:\n\n, where  is the largest integer not greater than x.\n\nThe input file consists of several datasets. The first line of the inpu...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of datasets.  \nLet $ D = \\{n_k \\mid k \\in \\{1, \\dots, t\\}\\} $ be the set of inputs, where each $ n_k \\in \\mathbb{Z}^+ $ and $ n_k \\leq 10^{12} ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments