logo AlgoBeat OnlineJudge
登录 注册

#201986. [USACO08DEC] Patting Heads S

内存限制:125 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

It's Bessie's birthday and time for party games! Bessie has instructed the () cows conveniently numbered to sit in a circle (so that cow [except at the ends] sits next to cows and ; cow sits next to cow ). Meanwhile, Farmer John fills a barrel with one billion slips of paper, each containing some integer in the range .

Each cow i then draws a number () (which is not necessarily unique, of course) from the giant barrel. Taking turns, each cow then takes a walk around the circle and pats the heads of all other cows such that her number is exactly divisible by cow 's number ; she then sits again back in her original position.

The cows would like you to help them determine, for each cow, the number of other cows she should pat.

输入格式

  • Line 1: A single integer:

  • Lines : Line contains a single integer:

输出格式

  • Lines : On line , print a single integer that is the number of other cows patted by cow .

样例

样例输入 1

5 
2 
1 
2 
3 
4 

样例输出 1

2 
0 
2 
1 
3 

数据范围与提示

The cows are given the numbers , , , , and , respectively.

The first cow pats the second and third cows; the second cow pats no cows; etc.