-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Chocolate.cpp
More file actions
53 lines (47 loc) · 981 Bytes
/
Copy pathA_Chocolate.cpp
File metadata and controls
53 lines (47 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*__________________In the name of Allah________________*/
/*___________________Solved By shafinkun________________*/
// Problem link : https://codeforces.com/contest/1934/problem/A
#include <bits/stdc++.h>
using namespace std;
#define optimize() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl '\n'
#define ll long long
#define yes puts("YES")
#define no puts("NO")
void solve(int a)
{
ll h, w, n;
cin >> h >> w >> n;
ll tot = h * w;
cerr << tot << endl;
for (ll i = 0; i < n; ++i)
{
ll x, temp;
cin >> x;
temp = pow(2, x);
tot -= temp;
tot -= temp;
if (tot < 0)
{
cout << "No" << endl;
return;
}
}
cerr << tot << endl;
cout << "Yes" << endl;
return;
}
int main()
{
optimize();
int t = 1;
// cin >> t;
while (t--)
{
solve(t);
}
return 0;
}