Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define elif else if
- #define ull unsigned long long
- int main(){
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- cout.tie(NULL);
- // freopen("auxiliary.in", "r", stdin);
- // freopen("auxiliary.out", "w", stdout);
- int h, w, n;
- cin>>h>>w>>n;
- int k, cs=0;
- int t=0;
- if(w<=h)
- {
- h--;
- t=1;
- if(w % 2==0)
- {
- k=w/2;
- cs=k*h;
- }
- if(w % 2==1)
- {
- k=(w+1)/2;
- cerr<<"k="<<k<<endl;
- if(h % 2==0)
- {
- cerr<<"h/2+1="<<h/2+1<<endl;
- cs=k*(h/2+1);
- cerr<<cs<<endl;
- cs+=(k-1)*(h-(h/2+1));
- cerr<<cs<<endl;
- }
- if(h % 2==1)
- {
- cs=k*((h+1)/2);
- cerr<<cs<<endl;
- cs+=(k-1)*(h-(h+1)/2);
- cerr<<cs<<endl;
- }
- }
- }
- else
- {
- w--;
- t=2;
- if(h % 2==0)
- {
- k=h/2;
- cerr<<"k="<<endl;
- cs=k*w;
- }
- if(h % 2==1)
- {
- k=(h+1)/2;
- if(w % 2==0)
- {
- cerr<<"w/2+1="<<w/2+1<<endl;
- cs=k*(w/2+1);
- cerr<<cs<<endl;
- cs+=(k-1)*(w-(w/2+1));
- cerr<<cs<<endl;
- }
- if(w % 2==1)
- {
- cs=k*((w+1)/2);
- cs+=(k-1)*(w-(w+1)/2);
- }
- }
- }
- cout<<cs<<endl;
- if(n>cs)
- {
- cout<<"Impossible";
- return 0;
- }
- for (int i=0; i<h; i++)
- {
- if
- for (int j=0; j<w; j++)
- {
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement