messages to expect. Then, each T compressed messages m are written Output The output should consist of T lines, with each line i consisting of the con as a rounded-off (round half up) nonnegative integer, and the uncompress Exomn

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Input
The input to your program starts with the number T on a line indicating the number of
messages to expect. Then, each T compressed messages m, are written on each line i.
Output
The output should consist of T lines, with each line i consisting of the compression ratio c
as a rounded-off (round half up) nonnegative integer, and the uncompressed message M
Example
Input
10a6b5c
abcdefabcdef
2ĉa2ĉaĥ2js
nña2ába3ß
そ8れな5あ
Output
3 aaaaaaaaaabbbbbbccccc
1 abcdefabcdef
1 ĉĉaĉĉahijs
1 nñaáábaßBB
3それれれれれれれれなあああああ
Additional Description/Requirements
Your program can only support the following specifications:
T < 100000
1 < len(m) < 100000
1s len(M) < 1000000
Vx EMU m, x E {UTF – 8}
The UTF-8 set is the set of (less than) 1112064 codepoints that correspond to a single
character. However, we limit ourselves to those characters commonly used by your friends,
so it will be way smaller than that. Whitespaces are also included in UTF-8!
Transcribed Image Text:Input The input to your program starts with the number T on a line indicating the number of messages to expect. Then, each T compressed messages m, are written on each line i. Output The output should consist of T lines, with each line i consisting of the compression ratio c as a rounded-off (round half up) nonnegative integer, and the uncompressed message M Example Input 10a6b5c abcdefabcdef 2ĉa2ĉaĥ2js nña2ába3ß そ8れな5あ Output 3 aaaaaaaaaabbbbbbccccc 1 abcdefabcdef 1 ĉĉaĉĉahijs 1 nñaáábaßBB 3それれれれれれれれなあああああ Additional Description/Requirements Your program can only support the following specifications: T < 100000 1 < len(m) < 100000 1s len(M) < 1000000 Vx EMU m, x E {UTF – 8} The UTF-8 set is the set of (less than) 1112064 codepoints that correspond to a single character. However, we limit ourselves to those characters commonly used by your friends, so it will be way smaller than that. Whitespaces are also included in UTF-8!
len(uncompressed)
C =
=
len(compressed)
Transcribed Image Text:len(uncompressed) C = = len(compressed)
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY