Acwing每日一题:最小的数
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 110;
int n;
int a[N], b[N];
int main()
{
cin >> n;
for (int i = 0; i < n; i ++ ) scanf("%d", &a[i]);
for (int i = 0; i < n; i ++ ) scanf("%d", &b[i]);
int x = 0, y = 0;
for (int i = 0; i < n; i ++ )
{
if(a[i] == 1 && b[i] == 0)
x ++ ;
else if(a[i] == 0 && b[i] == 1)
y ++ ;
}
if(x == 0)
cout << -1 << endl;
else if(y == 0) cout << 1 << endl;
else cout << y /x + 1 << endl;
return 0;
}