Use C Programming And Sorting Method Number Conversion Number conversion is a method that is often used in world of computing. This method aim to simplify the analysis and calculation process. Bibi, a novice data scientist, is looking at the series of data with irregular values. Each Ai value that Bibi sees can be anywhere from −10^18 to 10^18. Seeing such a large range of numeric values, Bibi asks you to do conversion on each value in the series so every new values is as minimum as possible while still maintaining larger, smaller and equal property with every other values in the initial series. The smallest number Bibi allow is 1. Help Bibi convert the number according to the criteria above. For example, there is a series with the values 99, -30, 0, 20, 1, 20. • the lowest value -30 is converted to 1. • second lowest value 0 is converted to 2. • third lowest value 1 is converted to 3. • lowest fourth value 20 is converted to 4. • the highest value 99 is converted to 5. Therefore, you get the new sequence 5, 1, 2, 4, 3, 4. Format Input There are T test cases. Each testcase contains the integer N ,which represents the amount of data in the series. On the next line there are N numbers which represents the value of each number in the series. Format Output Output T line with format “Case #X:”, where X represents the testcase number, then followed by N converted numbers. Constraints • 1 ≤ T ≤ 20 • 1 ≤ N ≤ 1000 • −10^18 ≤ Ai ≤ 10^17 Sample Input (standard input) 3 5 1 999 888 100 400 8 5 5 1 6 1 6 1 1 5 -30 -30 30 0 -10000 Sample Output (standard output) Case #1: 1 5 4 2 3 Case #2: 2 2 1 3 1 3 1 1 Case #3: 2 2 4 3 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Use C Programming And Sorting Method

Number Conversion

Number conversion is a method that is often used in world of computing. This method aim to simplify the analysis and calculation process. Bibi, a novice data scientist, is looking at the series of data with irregular values. Each Ai value that Bibi sees can be anywhere from −10^18 to 10^18. Seeing such a large range of numeric values, Bibi asks you to do conversion on each value in the series so every new values is as minimum as possible while still maintaining larger, smaller and equal property with every other values in the initial series. The smallest number Bibi allow is 1. Help Bibi convert the number according to the criteria above. For example, there is a series with the values 99, -30, 0, 20, 1, 20.

• the lowest value -30 is converted to 1.

• second lowest value 0 is converted to 2.

• third lowest value 1 is converted to 3.

• lowest fourth value 20 is converted to 4.

• the highest value 99 is converted to 5.

Therefore, you get the new sequence 5, 1, 2, 4, 3, 4.

Format Input

There are T test cases. Each testcase contains the integer N ,which represents the amount of data in the series. On the next line there are N numbers which represents the value of each number in the series.

Format Output

Output T line with format “Case #X:”, where X represents the testcase number, then followed by N converted numbers.

Constraints

• 1 ≤ T ≤ 20

• 1 ≤ N ≤ 1000

• −10^18 ≤ Ai ≤ 10^17

Sample Input (standard input)

3

5

1 999 888 100 400

8

5 5 1 6 1 6 1 1

5

-30 -30 30 0 -10000

Sample Output (standard output)

Case #1: 1 5 4 2 3

Case #2: 2 2 1 3 1 3 1 1

Case #3: 2 2 4 3 1

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education