Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- long int spos = 0;
- long long int w, h, s;
- cin >> h >> w >> s;
- if (s > h * w) cout << 0;
- else if (s == h * w) cout << 1;
- else
- {
- for (long long int i = 1; i <= s; ++i) {
- long long int dr = s / i;
- if (s % i == 0) {
- long int vd = h + 1 - dr;
- long int vsh = w + 1 - i;
- if (vd * vsh >= 0) spos += vd * vsh;
- }
- }
- cout << spos;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement