#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int>array;
for (int i = 0; i < 5; ++i)
{
int temp;
cin >> temp;
array.push_back(temp);
}
int value;
cin >> value;
if (value < 1)
{
cout << -1;
return 0;
}
int money[6] = { 100,50,10,5,1 };
int ans=0;
for (int j = 5; j >0; --j)
{
while (value >= money[j] && array[j] > 0)
{
ans++;
array[j]--;
value = value - money[j];
}
}
if(value!=0) return -1;
else cout << ans << endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
//矩形1
int x1,y1,x2,y2;
//矩形2
int a1,b1,a2,b2;
cin >> x1 >> y1 >> x2 >> y2;
cin >> a1 >> b1 >> a2 >> b2;
if(b1 > y2 && b2 > y2)
cout << 0;
else if(b1 < y1 && b2 < y1)
cout << 0;
else if(a1 > x2 && a2 > x2)
cout << 0;
else if(a1 < x1 && a2 < x1)
cout << 0;
else
cout << 1;
return 0;
}
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
string str;
cin >> str;
string ans;
bool flag = false;
for (char& c : str)
{
if (c == '+')
continue;
else if (c == '-')//负负=正
flag = !flag;
else //出现第一个不为+-的字符就终止
break;
}
if(flag) ans+='-';
for (char& c:str)
{
if (c >= '0' && c <= '9')
ans.push_back(c);
}
cout << ans << endl;
return 0;
}