All Tracks Problem

Play with Ranges!
Tag(s):

Easy-Medium, 简单偏中, 簡単-普通

Problem
Editorial
Analytics

Mishki loves to play with data and now she wants some interesting data from the given data. Given two tables:

1) Range_Details : It consists one column Limits containing the ranges of the height of the students, in the form of a-b, where a the lower limit and b is the upper limit of the height.

2) Heights: It consists of one column Height containing the heights of people.

For each height in the Height table, you need to tell the ranges, in which the height is between its lower and upper limit (inclusive both limits). The ranges should be printed in the sorted order of their difference of upper and lower limit.

The data should be printed in the ascending order of heights.

Input Format:

Table : Range_Details

Field Type
Limits text

Table: Heights

Field Type
Height int

Output Format:

Field Type
Height int
Specific_Ranges text

Sample Input:

Sample Range_Details Table:

Limits
0-9
7-12
4-4

Sample Heights Table:

Height
9
4

Sample Output:

Height Specific_Ranges
4 4-4,0-9
9 7-12,0-9
Time Limit: 5 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: MySQL, PostgreSQL, MSSQL, Oracle Database

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications