Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Bismillahir Rahman-ir Rahim
- #include <bits/stdc++.h>
- using namespace std;
- #define MAX 32000
- #define PI acos(-1)
- #define debug(x) cout << '>' << #x << " : " << x << endl;
- #define all(c) c.begin(), c.end()
- //#define m (pow(10, 9)+7)
- typedef unsigned long long ull;
- typedef long long ll;
- /*
- ll rect_count(ll n, ll m)
- {
- ll x = n*(n+1)/2, y = m*(m+1)/2;
- return x*y;
- }
- */
- ll sum_of_area(ll n, ll m)
- {
- ll x = 0, y = 0;
- for(size_t i = 1, j = n; i <= n; i++, j--){
- x += j*i;
- }
- for(size_t i = 1, j = m; i <= m; i++, j--){
- y += j*i;
- }
- return x*y;
- }
- int main()
- {
- //freopen("input.txt", "r", stdin);
- //freopen("output.txt", "w", stdout);
- ll n, m;
- cin >> n >> m;
- cout << sum_of_area(n, m) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement