This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n, k, x, y, xx, yy;
ll d, mn = INT_MAX;
ll ch ( ll del ) {
	ll ans = 0;
	if ( del == 1 ) {
		return (n*n)/2;
	}
	if ( (n / del) % 2 == 1 ) {
		ans = ((n/del)+1) * (del*del);
	}
	else {
		ans = ((n/del)) * (del*del);
	}
	return ans;
}
int main()
{
	cin >> n >> k;
	for ( int i = 1; i <= k; i ++ ) {
		cin >> x >> y >> xx >> yy;
	}
	for ( int i = 1; i < n; i ++ ) {
		if ( n % i == 0 ) {
			mn = min ( mn, ch(i) );
		}
	}
	cout << mn;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |