简单bfs
#include<bits/stdc++.h>
using namespace std;
#define maxn 205
typedef long long ll;
struct point
{
ll x;
ll y;
}a[maxn];
struct node
{
int pos;
int num;
int cnt;
node(int _pos=0,int _num=0,int _cnt=0)
{
pos=_pos;
num=_num;
cnt=_cnt;
}
};
int n,m,k;
ll r;
bool vis[maxn];
bool judge(ll x1,ll y1,ll x2,ll y2)
{
if(sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))<=r)
return true;
else
return false;
}
int bfs()
{
memset(vis,false,sizeof vis);
node aa(1,1,0);
queue<node> q;
vis[1]=true;
q.push(aa);
node t;
while(!q.empty())
{
t=q.front();
q.pop();
int p=t.pos;
int num=t.num;
int cnt=t.cnt;
for(int i=2;i<=n+m;i++)
{
int pp=i;
int nn=num+1;