3372 - Conting Edges 3372 - Conting Edges 3372 - Conting Edges

Statistics Sub: 185 | AC: 149 | AC%: 80,54 | Score: 1,32
Created by Yonny Mondelo Hernández
Added by luismo (2015-07-12)
Limits
Total Time: 10000 MS | Test Time: 1000 MS |Memory: 256 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

You are given a directed graph with exactly N nodes. The nodes are conveniently numbered between 1 and N. Your task is to count the number of edges of the given graph.

But this is not a ordinary graph; this is a special graph for which each node has exactly one directed edge going to their greatest proper divisor if there is one (node numbered with that value). A proper divisor of some integer number P is any divisor of P, excluding P itself. For example, 1, 2, and 3 are proper divisors of 6, but 6 itself is not.

Can you find the number of edges of the given graph if you know the amount of nodes?
You are given a directed graph with exactly N nodes. The nodes are conveniently numbered between 1 and N. Your task is to count the number of edges of the given graph.

But this is not a ordinary graph; this is a special graph for which each node has exactly one directed edge going to their greatest proper divisor if there is one (node numbered with that value). A proper divisor of some integer number P is any divisor of P, excluding P itself. For example, 1, 2, and 3 are proper divisors of 6, but 6 itself is not.

Can you find the number of edges of the given graph if you know the amount of nodes?
You are given a directed graph with exactly N nodes. The nodes are conveniently numbered between 1 and N. Your task is to count the number of edges of the given graph.

But this is not a ordinary graph; this is a special graph for which each node has exactly one directed edge going to their greatest proper divisor if there is one (node numbered with that value). A proper divisor of some integer number P is any divisor of P, excluding P itself. For example, 1, 2, and 3 are proper divisors of 6, but 6 itself is not.

Can you find the number of edges of the given graph if you know the amount of nodes?

Input specification

The first line contain a integer 1 <= T <= 100 representing the amount of graphs that will be given. The next T lines contains a integer number 1 <= N <= 1000 representing the amount of nodes in the graph. Scenarios must be answered in the same order that graphs are given in the input.
The first line contain a integer 1 <= T <= 100 representing the amount of graphs that will be given. The next T lines contains a integer number 1 <= N <= 1000 representing the amount of nodes in the graph. Scenarios must be answered in the same order that graphs are given in the input.
The first line contain a integer 1 <= T <= 100 representing the amount of graphs that will be given. The next T lines contains a integer number 1 <= N <= 1000 representing the amount of nodes in the graph. Scenarios must be answered in the same order that graphs are given in the input.

Output specification

For each graph you must print a line containing a integer number representing the number of edges of the graph.
For each graph you must print a line containing a integer number representing the number of edges of the graph.
The first line contain a integer 1 <= T <= 100 representing the amount of graphs that will be given. The next T lines contains a integer number 1 <= N <= 1000 representing the amount of nodes in the graph. Scenarios must be answered in the same order that graphs are given in the input.

Sample input

2
1
3

Sample output

0
2

Hint(s)

http://coj.uci.cu/24h/
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/

Recommendation

We have carefully selected several similar problems: 3378 | 3377 | 2916 | 3303 | 3361 | 2926