Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define elif else if
  5. #define ull unsigned long long
  6.  
  7. int main(){
  8. ios_base::sync_with_stdio(false);
  9. cin.tie(NULL);
  10. cout.tie(NULL);
  11. // freopen("auxiliary.in", "r", stdin);
  12. // freopen("auxiliary.out", "w", stdout);
  13.  
  14. int h, w, n;
  15. cin>>h>>w>>n;
  16. int k, cs=0;
  17. int t=0;
  18. if(w<=h)
  19. {
  20. h--;
  21. t=1;
  22. if(w % 2==0)
  23. {
  24. k=w/2;
  25. cs=k*h;
  26. }
  27. if(w % 2==1)
  28. {
  29. k=(w+1)/2;
  30. cerr<<"k="<<k<<endl;
  31. if(h % 2==0)
  32. {
  33. cerr<<"h/2+1="<<h/2+1<<endl;
  34. cs=k*(h/2+1);
  35. cerr<<cs<<endl;
  36. cs+=(k-1)*(h-(h/2+1));
  37.  
  38. cerr<<cs<<endl;
  39. }
  40. if(h % 2==1)
  41. {
  42. cs=k*((h+1)/2);
  43. cerr<<cs<<endl;
  44. cs+=(k-1)*(h-(h+1)/2);
  45. cerr<<cs<<endl;
  46. }
  47. }
  48.  
  49. }
  50. else
  51. {
  52. w--;
  53. t=2;
  54. if(h % 2==0)
  55. {
  56. k=h/2;
  57. cerr<<"k="<<endl;
  58. cs=k*w;
  59. }
  60. if(h % 2==1)
  61. {
  62. k=(h+1)/2;
  63. if(w % 2==0)
  64. {
  65.  
  66. cerr<<"w/2+1="<<w/2+1<<endl;
  67. cs=k*(w/2+1);
  68.  
  69. cerr<<cs<<endl;
  70. cs+=(k-1)*(w-(w/2+1));
  71. cerr<<cs<<endl;
  72. }
  73. if(w % 2==1)
  74. {
  75. cs=k*((w+1)/2);
  76. cs+=(k-1)*(w-(w+1)/2);
  77. }
  78. }
  79. }
  80. cout<<cs<<endl;
  81. if(n>cs)
  82. {
  83. cout<<"Impossible";
  84. return 0;
  85. }
  86. for (int i=0; i<h; i++)
  87. {
  88. if
  89. for (int j=0; j<w; j++)
  90. {
  91.  
  92. }
  93. }
  94. return 0;
  95.  
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement