Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int a[100][100], m, n, i, j, k, x, y, zbir, br=0;
- scanf("%d%d", &m, &n);
- for(i=0; i<m; i++){
- for(j=0; j<n; j++)
- scanf("%d", &a[i][j]);
- }
- scanf("%d", &k);
- zbir=0;
- for(i=0; i<k; i++){
- scanf("%d%d", &x, &y);
- if(((x>=0)&&(x<=m-1))&&((y>=0)&&(y<=n-1))){
- zbir+=a[x][y];
- br++;
- }
- }
- printf("%d", zbir/br);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement