Company: phonepe_1aug
Difficulty: medium
Framewright Tournament Problem Description In the land of Tricolor, there are three master guilds, each famous for their crafting materials: The Crimson Guild (Red sticks) The Verdant Guild (Green sticks) The Azure Guild (Blue sticks) Each guild sends its finest materials to the Framewright Tournament - where artisans from across the realm craft rectangular frames using matching stick pairs. Each crate from a guild contains pairs of sticks of equal length - glued and polished together, never separated. Your Mission is the Framewright: You can craft a rectangular display frame using: One pair of sticks from one guild (for height), and One pair from a different guild (for width). Each frame's value is the area: length × width = value. Your goal: Craft the most valuable set of frames possible using the available pairs. Rules: Only mix sticks from different guilds (no red-red, green-green, etc.). Each pair can be used at most once. You don't have to use every pair. Input Format The first l