*for pp in range(1,P+1): *

can be optimized to

*for pp in range(1,min(P, (nn+1)*K)+1):*

This should allow your code to pass the test set 2

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/57bb2d9e-75e1-48df-9391-d0a9bef85995%40googlegroups.com.

Reply via email to