#include<iostream>
#include<cmath>
#include<cstring>
#include<queue>
using namespace std;
const int N = 10010;
typedef pair<int, int> pll;
priority_queue < pll, vector <pll>, greater<pll>> heap;
int g[N][N], dist[N]; bool str[N];
int n; int idx, en[N], e[N],w[N],h[N];
void add(int a, int b, int c)
{
e[idx] = b; w[b] = c; en[idx] = h[a]; h[a] = idx++;
}
int dijkstra()
{
heap.push({ 0,1 });
while (heap.size())
{
auto t = heap.top();
heap.pop();
int ver = t.second; int distance = t.first;
if (str[ver])continue;
for (int i = h[ver]; i != -1; i = en[i])
{
int j = e[i];
if (dist[j] > distance + w[j])
{
dist[j] = distance + w[j];
heap.push({ dist[j],j });
}
}
if (dist[n] == 0x3f)return -1;
else return dist[n];
}
}
int main()
{
memset(g, 0x3f, sizeof g);
}