in far away kingdom live greedy king to defend land build n guard tower Apart tower kingdom army head tyrannical narcissistic general the general can not stand specifically let soldier army present towerdure defence operation manage guard tower general send army tower each general ask fee king manage tower as live far away kingdom general evaluate fee follow weird manner find remotest distant tower soldier army situate ask fee equal distance each tower represent point plane coordinate xy distance point coordinate x1y1 x2y2 determined kingdom x1x2y1y2The greedy king exactly satisfied requirement general that s agree pay fee general equal maximum demand fee however king green greed way arrange tower army wants find cheapest each tower occupy soldier exactly armyHe hire you find minimum money pay fee and king scrupulous count number arrangement cost money as number large king know remainder divide 1097two arrangement distinct set tower occupy soldier general distinct