Discover interview question

Given a chart with raw data and output, write the query