Kth Minimum Clique
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Given a vertex-weighted graph with N vertices, find out the K-th minimum weighted clique.

A subset of vertices of an undirected graph is called clique if and only if every two distinct vertices in the subset are adjacent. The weight of a clique is the summation of the weight of vertices in it.

输入描述:

The first line of input contains two space-separated integers N, K.
The second line of input contains N space-separated integers w_i representing the weight of each vertex.
Following N lines each contains N characters . There's an edge between vertex i and vertex j if and only if .






输出描述:

Output one line containing an integer representing the answer. If there's less than K cliques, output .
示例1

输入

复制
2 3
1 2
01
10

输出

复制
2

说明

An empty set is considered as a clique.