#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
const int mod = 1e9 + 7;
const int N = 2e5 + 10;
pair<int,int>arr[105];
int n , k , vist[105][(1 << 11)];
long double dp[105][(1 << 11)];
long double dist(int &a , int &b)
{
return (long double)hypot(arr[b].S - arr[a].S , arr[b].F - arr[a].F);
}
long double rec(int ind , int bit)
{
if((1 << k)-1 == bit)
return 0;
if (vist[ind][bit])return dp[ind][bit];
vist[ind][bit] = 1;
long double minn = 1e9;
for(int j = 0 ; j < k ; ++j)
if (((bit >> j)&1) == 0)
minn = min(minn , rec(ind , bit | (1 << j))+dist(ind , j));
for (int i = k ; i < n ; ++i)
{
for (int j = 0 ; j < k ; ++j)
if ((((bit >> j)&1) == 0))
minn = min(minn , rec(i , bit | (1 << j))+dist(i , j)+dist(ind , i));
}
return dp[ind][bit] = minn;
}
int main ()
{
cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
cin >> n >> k;
for (int i = 0 ; i < n ; ++i)
cin >> arr[i].F >> arr[i].S;
long double ans = 1e9;
for(int i = k ; i < n ; ++i)
{
memset(vist , 0 , sizeof vist);
for (int j = 0 ; j < k ; ++j)
ans = min(ans , rec(i , (1 << j))+dist(i , j));
}
printf("%.5LF\n" , ans);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgRiBmaXJzdAojZGVmaW5lIFMgc2Vjb25kCmNvbnN0IGludCBtb2QgPSAxZTkgKyA3Owpjb25zdCBpbnQgTiA9IDJlNSArIDEwOwpwYWlyPGludCxpbnQ+YXJyWzEwNV07CmludCBuICwgayAsIHZpc3RbMTA1XVsoMSA8PCAxMSldOwpsb25nIGRvdWJsZSBkcFsxMDVdWygxIDw8IDExKV07CmxvbmcgZG91YmxlIGRpc3QoaW50ICZhICwgaW50ICZiKQp7CiAgICByZXR1cm4gKGxvbmcgZG91YmxlKWh5cG90KGFycltiXS5TIC0gYXJyW2FdLlMgLCBhcnJbYl0uRiAtIGFyclthXS5GKTsKfQpsb25nIGRvdWJsZSByZWMoaW50IGluZCAsIGludCBiaXQpCnsKICAgIGlmKCgxIDw8IGspLTEgPT0gYml0KQogICAgICAgIHJldHVybiAwOwogICAgaWYgKHZpc3RbaW5kXVtiaXRdKXJldHVybiBkcFtpbmRdW2JpdF07CiAgICB2aXN0W2luZF1bYml0XSA9IDE7CiAgICBsb25nIGRvdWJsZSBtaW5uID0gMWU5OwogICAgZm9yKGludCBqID0gMCA7IGogPCBrIDsgKytqKQogICAgICAgIGlmICgoKGJpdCA+PiBqKSYxKSA9PSAwKQogICAgICAgICAgICBtaW5uID0gbWluKG1pbm4gLCByZWMoaW5kICwgYml0IHwgKDEgPDwgaikpK2Rpc3QoaW5kICwgaikpOwogICAgZm9yIChpbnQgaSA9ICBrIDsgaSA8IG4gOyArK2kpCiAgICB7CiAgICAgICAgZm9yIChpbnQgaiA9ICAwIDsgaiA8ICBrIDsgKytqKQogICAgICAgICAgICBpZiAoKCgoYml0ID4+IGopJjEpID09IDApKQogICAgICAgICAgICAgICAgbWlubiA9IG1pbihtaW5uICwgcmVjKGkgLCBiaXQgfCAoMSA8PCBqKSkrZGlzdChpICwgaikrZGlzdChpbmQgLCBpKSk7CiAgICB9CiAgICByZXR1cm4gZHBbaW5kXVtiaXRdID0gbWlubjsKfQppbnQgbWFpbiAoKQp7CiAgICBjaW4udGllKDApO2NvdXQudGllKDApO2lvczo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbiA+PiBuID4+IGs7CiAgICBmb3IgKGludCBpID0gMCA7IGkgPCBuIDsgKytpKQogICAgICAgIGNpbiA+PiBhcnJbaV0uRiA+PiBhcnJbaV0uUzsKICAgIGxvbmcgZG91YmxlIGFucyA9IDFlOTsKICAgIGZvcihpbnQgaSA9IGsgOyBpIDwgbiA7ICsraSkKICAgIHsKICAgICAgICBtZW1zZXQodmlzdCAsIDAgLCBzaXplb2YgdmlzdCk7CiAgICAgICAgZm9yIChpbnQgaiA9IDAgOyBqIDwgayA7ICsraikKICAgICAgICAgICAgYW5zID0gbWluKGFucyAsIHJlYyhpICwgKDEgPDwgaikpK2Rpc3QoaSAsIGopKTsKICAgIH0KCiAgICBwcmludGYoIiUuNUxGXG4iICwgYW5zKTsKcmV0dXJuIDA7Cn0K
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
^
Main.java:3: error: illegal character: '#'
#define ll long long
^
Main.java:3: error: class, interface, or enum expected
#define ll long long
^
Main.java:4: error: illegal character: '#'
#define F first
^
Main.java:5: error: illegal character: '#'
#define S second
^
Main.java:7: error: class, interface, or enum expected
const int N = 2e5 + 10;
^
Main.java:8: error: class, interface, or enum expected
pair<int,int>arr[105];
^
Main.java:9: error: class, interface, or enum expected
int n , k , vist[105][(1 << 11)];
^
Main.java:10: error: class, interface, or enum expected
long double dp[105][(1 << 11)];
^
Main.java:11: error: class, interface, or enum expected
long double dist(int &a , int &b)
^
Main.java:14: error: class, interface, or enum expected
}
^
Main.java:19: error: class, interface, or enum expected
if (vist[ind][bit])return dp[ind][bit];
^
Main.java:20: error: class, interface, or enum expected
vist[ind][bit] = 1;
^
Main.java:21: error: class, interface, or enum expected
long double minn = 1e9;
^
Main.java:22: error: class, interface, or enum expected
for(int j = 0 ; j < k ; ++j)
^
Main.java:22: error: class, interface, or enum expected
for(int j = 0 ; j < k ; ++j)
^
Main.java:22: error: class, interface, or enum expected
for(int j = 0 ; j < k ; ++j)
^
Main.java:25: error: class, interface, or enum expected
for (int i = k ; i < n ; ++i)
^
Main.java:25: error: class, interface, or enum expected
for (int i = k ; i < n ; ++i)
^
Main.java:25: error: class, interface, or enum expected
for (int i = k ; i < n ; ++i)
^
Main.java:27: error: class, interface, or enum expected
for (int j = 0 ; j < k ; ++j)
^
Main.java:27: error: class, interface, or enum expected
for (int j = 0 ; j < k ; ++j)
^
Main.java:30: error: class, interface, or enum expected
}
^
Main.java:32: error: class, interface, or enum expected
}
^
Main.java:35: error: class, interface, or enum expected
cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
^
Main.java:35: error: class, interface, or enum expected
cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
^
Main.java:36: error: class, interface, or enum expected
cin >> n >> k;
^
Main.java:37: error: class, interface, or enum expected
for (int i = 0 ; i < n ; ++i)
^
Main.java:37: error: class, interface, or enum expected
for (int i = 0 ; i < n ; ++i)
^
Main.java:37: error: class, interface, or enum expected
for (int i = 0 ; i < n ; ++i)
^
Main.java:39: error: class, interface, or enum expected
long double ans = 1e9;
^
Main.java:40: error: class, interface, or enum expected
for(int i = k ; i < n ; ++i)
^
Main.java:40: error: class, interface, or enum expected
for(int i = k ; i < n ; ++i)
^
Main.java:40: error: class, interface, or enum expected
for(int i = k ; i < n ; ++i)
^
Main.java:43: error: class, interface, or enum expected
for (int j = 0 ; j < k ; ++j)
^
Main.java:43: error: class, interface, or enum expected
for (int j = 0 ; j < k ; ++j)
^
Main.java:43: error: class, interface, or enum expected
for (int j = 0 ; j < k ; ++j)
^
Main.java:45: error: class, interface, or enum expected
}
^
Main.java:48: error: class, interface, or enum expected
return 0;
^
Main.java:49: error: class, interface, or enum expected
}
^
41 errors