A. Fafa and his Company

Codeforces
IDCF935A
Time1000ms
Memory256MB
Difficulty
brute forceimplementation
English · Original
Chinese · Translation
Formal · Original
Fafa owns a company that works on huge projects. There are _n_ employees in Fafa's company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project among all the employees. Fafa finds doing this every time is very tiring for him. So, he decided to choose the best _l_ employees in his company as team leaders. Whenever there is a new project, Fafa will divide the tasks among only the team leaders and each team leader will be responsible of some positive number of employees to give them the tasks. To make this process fair for the team leaders, each one of them should be responsible for the same number of employees. Moreover, every employee, who is not a team leader, has to be under the responsibility of exactly one team leader, and no team leader is responsible for another team leader. Given the number of employees _n_, find in how many ways Fafa could choose the number of team leaders _l_ in such a way that it is possible to divide employees between them evenly. ## Input The input consists of a single line containing a positive integer _n_ (2 ≤ _n_ ≤ 105) — the number of employees in Fafa's company. ## Output Print a single integer representing the answer to the problem. [samples] ## Note In the second sample Fafa has 3 ways: * choose only 1 employee as a team leader with 9 employees under his responsibility. * choose 2 employees as team leaders with 4 employees under the responsibility of each of them. * choose 5 employees as team leaders with 1 employee under the responsibility of each of them.
Fafa 拥有一家从事大型项目公司的公司。Fafa 的公司有 #cf_span[n] 名员工。每当公司有新项目需要启动时,Fafa 都需要将该项目的任务分配给所有员工。 Fafa 发现每次这样做都非常疲惫。因此,他决定从公司中选出最好的 #cf_span[l] 名员工作为团队负责人。每当有新项目时,Fafa 只会将任务分配给这些团队负责人,每位团队负责人负责一定数量的员工(必须为正数)来分配任务。为了使这一过程对团队负责人公平,每位负责人负责的员工人数必须相同。此外,所有非团队负责人的员工必须恰好属于一位团队负责人的管辖范围,且没有任何团队负责人负责其他团队负责人。 给定员工总数 #cf_span[n],求 Fafa 可以选择多少种团队负责人数量 #cf_span[l] 的方式,使得能够将员工平均分配给他们。 输入由一行包含一个正整数 #cf_span[n] (#cf_span[2 ≤ n ≤ 105]) 组成,表示 Fafa 公司的员工数量。 输出一个整数,表示问题的答案。 在第二个样例中,Fafa 有 3 种方式: ## Input 输入由一行包含一个正整数 #cf_span[n] (#cf_span[2 ≤ n ≤ 105]) 组成,表示 Fafa 公司的员工数量。 ## Output 输出一个整数,表示问题的答案。 [samples] ## Note 在第二个样例中,Fafa 有 3 种方式:选择 #cf_span[1] 名员工作为团队负责人,由其负责 #cf_span[9] 名员工;选择 #cf_span[2] 名员工作为团队负责人,每人负责 #cf_span[4] 名员工;选择 #cf_span[5] 名员工作为团队负责人,每人负责 #cf_span[1] 名员工。
**Definitions** Let $ n \in \mathbb{Z} $, $ n \geq 2 $, be the number of employees. Let $ l \in \mathbb{Z} $ be the number of team leaders, where $ 1 \leq l < n $. **Constraints** 1. $ l $ must divide $ n - l $, i.e., $ l \mid (n - l) $. 2. Each team leader is responsible for a positive integer number of employees: $ \frac{n - l}{l} \geq 1 $. **Objective** Count the number of integers $ l $ satisfying: $$ l \mid (n - l) \quad \text{and} \quad 1 \leq l < n $$ Equivalently, count the number of divisors $ l $ of $ n $ such that $ 1 \leq l < n $ and $ l \mid n $.
Samples
Input #1
2
Output #1
1
Input #2
10
Output #2
3
API Response (JSON)
{
  "problem": {
    "name": "A. Fafa and his Company",
    "description": {
      "content": "Fafa owns a company that works on huge projects. There are _n_ employees in Fafa's company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project amo",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF935A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Fafa owns a company that works on huge projects. There are _n_ employees in Fafa's company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project amo...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "Fafa 拥有一家从事大型项目公司的公司。Fafa 的公司有 #cf_span[n] 名员工。每当公司有新项目需要启动时,Fafa 都需要将该项目的任务分配给所有员工。\n\nFafa 发现每次这样做都非常疲惫。因此,他决定从公司中选出最好的 #cf_span[l] 名员工作为团队负责人。每当有新项目时,Fafa 只会将任务分配给这些团队负责人,每位团队负责人负责一定数量的员工(必须为正数)来分配任务...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ n \\geq 2 $, be the number of employees.  \nLet $ l \\in \\mathbb{Z} $ be the number of team leaders, where $ 1 \\leq l < n $.  \n\n**Constraints**  \n1. $ l $ mu...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments