#include <bits/stdc++.h>
using namespace std;

int N,M,a[50005],b[50005],c[50005],d[50005];

int main(){
    cin>>N>>M;
    scanf("%d%d", &N, &M);
    int zemljiste[N][M];
    for(int i = 1;i<=N;i++){
        scanf("%d%d",&a[i],&b[i]);
    }
    for(int j = 1;j<=M;j++){
        scanf("%d%d",&c[j],&d[j]);
    }
    for(int i = 1;i<=N;i++){
        for(int j = 1;j<=M;j++){
            if(a[i]>0 and c[i]>0){
                memset(zemljiste, min(a[i],c[i])/min(N,M), sizeof(zemljiste));
            }
        }
    }

    return 0;
}