Company: IBM_14sep
Difficulty: medium
Garden Watering System Problem Description In a large resort's botanical garden there are N x N square plots, arranged neatly in rows and columns. Each plot starts with 0 liters of water. The gardener, Sourabh, uses two types of watering systems: A horizontal sprinkler that waters an entire row of plots at once. A vertical sprinkler that waters an entire column of plots at once. Each time he runs a sprinkler, it adds a certain amount of water to every plot in that row or column. After a series of watering actions, Sourabh wants to know how much water the most watered plot in the garden holds, that is, the largest amount of water held by any single plot. Complete the function solve , which takes N and the list of watering actions (their kinds, indices and amounts, in the order they were performed) and returns that largest amount. Input Format Read from standard input. N Q <action 1> <action 2> ... <action Q> The first line contains two integers separated by a space: N