Simple math

HackerRank “Army Game” solution in C++:

#include <iostream>
using namespace std;
int main(){
  int n, m;
  cin >> n >> m;
  cout << (n/2+n%2)*(m/2+m%2);
  return 0;
}

Leave a Reply

Name *
Email *
Website