某一天,Alice 比较无聊,于是她为自己发明了一个游戏玩。首先她在纸上画了一个圆,然 后从这个圆的圆弧上均匀地取出 n 个点,这 n 个点将圆 n 等分。接下来,Alice 每次从这 n 个点中选取两个点,在这两个点之间画一条线段,但是要求这条线段不能与已有的线段相交 (允许在端点处相交)。为了能打发更多的时间,Alice 希望能画尽量多的线段,请你告诉她 最多她能画出几条线段?
数据范围: 
第一行包含一个整数𝑛,表示从圆弧上取出的点数。
输出对应的答案。
2
1
4
5
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
System.out.println(2*n - 3);
}
} import java.util.Scanner;
public class Main {
/**
* 思路:
* 1.通过写几个测试用例可以发现这就是一个等差数列
* 2.a1=1,d=2
* 3.所以公式就是:a1+(n-1)*d
* 4.但是这里的n是从2开始的,所以需要多-1
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int a1 = 1;
int result = a1 + (n - 2) * 2;
System.out.println(result);
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(2 * (n - 1) - 1);
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* @author wylu
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println(2 * Integer.parseInt(br.readLine()) - 3);
}
}
#include <stdio.h>
#include <stdlib.h>
int func(int x)
{
if(x<4)
return 0;
else if(x==4)
return 1;
else
return x/2+func(x/2+x%2);
}
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
if(n<2)
printf("0\n");
else if(n==2)
printf("1\n");
else
{
printf("%d\n",n+func(n));
}
}
return 0;
} import sys def get_result(number): if numbers == 2: return 1 else: return number+(number-3) for line in sys.stdin: a = line.split() numbers = int(a[0]) print(get_result(numbers))