Vladik and Entertaining Flags time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output In his spare time Vladik estimates beauty of the flags. Every flag could be represented as the matrix n × m wh…