You are given N strings. Each string is given in the form of an array cnt of size 26 where the ith element in array denotes the count of the ith character of lowercase English alphabets in the string.
You have to select exactly 4 strings and insert the strings into a Trie. You are allowed to shuffle the characters in each string.
Task
Determine the minimum number of nodes present in Trie if the strings are selected optimally.
Notes
Input format
Output format
For each test case, print the minimum number of nodes present in Trie in a new line.
Constraints
1≤T≤54≤N≤200≤cnt[i][j]≤105
Approach