/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.c * Author: tym7 * * Created on October 20, 2018, 10:58 AM */ #include #include #include struct Point{ int x; int y; }; /* * */ int main(int argc, char** argv) { int n_guards,n_incidents,distance,s_dist; int in = 0; struct Point *guards,*incidents; in = scanf("%d %d",&n_guards,&n_incidents); guards = calloc(n_guards,sizeof(struct Point)); incidents = calloc(n_incidents,sizeof(struct Point)); for(int i = 0;ix,&(guards+i)->y); } for(int i = 0;ix,&(incidents+i)->y); } //scout = malloc() for(int j = 0;jx)-((incidents+j)->x)); int ydif = abs(((guards+i)->y)-((incidents+j)->y)); distance = abs(xdif - ydif) + (xdif>ydif?ydif:xdif); if(distance