Problem:
Score : 100 points

Problem Statement

How many ways are there to choose two distinct positive integers totaling N, disregarding the order?

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

4

Sample Output 1

1

There is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)

Sample Input 2

999999

Sample Output 2

499999

Solution in C (GCC 5.4.1) (judge verdict: Runtime Error)

#include <stdio.h>
int po(int x, int n){
  if(x == 0 && n == 0) return 1;

  int i, y = x;
  for(i = 1; i < n; i++){
    y *= x;
  }
  return y;
}

int main(void){
  int N;
  scanf("%d", &N);
  int a[N];
  int c[100001]={};

  for(int i=0; i<N; i++){
    scanf("%d", &a[i]);
    c[a[i]]++;
  }

  long long ans = 1;
  
  if(c[0] != 1) {
    printf("0");
    return 0;
  }

  for(int i=0; i<100000; i++){
    if(c[i] == 0 && c[i+1] != 0){
      printf("0");
      return 0;
    }
  }

  for(int i=0; i<100000; i++){
    ans = (ans * po(c[i], c[i+1])) % 998244353;
  }

  printf("%ld", ans); 
  return 0;
}