import java.io.BufferedInputStream;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(new BufferedInputStream(System.in));
BigInteger num, two = BigInteger.valueOf(2), one = BigInteger.ONE;
while (cin.hasNext()) {
num = cin.nextBigInteger();
if (num.mod(two).compareTo(one) == 0) {
num = num.subtract(one).divide(two);
} else {
num = num.divide(two).subtract(one);
if (num.mod(two).compareTo(one) != 0) {
num = num.subtract(one);
}
}
System.out.println(num);
}
}
}

相关文章:

  • 2021-08-25
  • 2021-05-26
  • 2022-02-01
  • 2021-12-11
  • 2021-05-20
  • 2021-12-22
  • 2021-11-03
  • 2022-01-15
猜你喜欢
  • 2021-08-02
  • 2021-06-20
  • 2021-06-27
  • 2022-01-07
  • 2022-12-23
  • 2021-10-05
  • 2021-12-06
相关资源
相似解决方案