ACM ICPC World Finals 2016
Shortest judge solution: 798 bytes. Shortest team solution (during contest): 731 bytes.
This problem can be solved in a few different ways, ranging from dynamic programming to writing a regular expression describing k-quotations, but let us describe an inductive definition/characterization of sequences of k-quotations that directly leads to a simple greedy algorithm for checking if a given input is a k-quotation.
For k = 1, a string is a sequence of 1-quotations if it starts and ends with a quote character, and contains an even number of quote characters.
For k > 1, a string is a sequence of k-quotations if it is also a k-quotation. To see this, take an arbitrary sequence of k-quotations. This sequence must start with k quote characters then k − 1 quote characters (possibly after some spaces) then k − 2 quotes, and so on. The analogous pattern in reverse must hold at the end. In between there must be an even number of quote characters (since in total there must be an even number of quotes), which, by the k = 1 case, is a valid sequence of 1-quotations, meaning that the entire string is a valid k-quotation.
In other words, the only situation in which a k-quotation is not the same as a sequence of k-quotations is when k = 1. This directly leads to a recursive greedy solution that tries all k (you should try all k such that k (k − 1) ≥ #{quote characters}).