1796227230a:3:{s:6:"coding";a:15:{i:0;O:8:"stdClass":4:{s:2:"id";i:771;s:5:"title";s:51:"Fraction String to Decimal and Percentage Formatter";s:5:"level";s:4:"Hard";s:8:"question";s:1069:"

Problem Name: Fraction String to Decimal and Percentage Formatter

Problem Description:
Read a fraction string in the form "num/den" (e.g., "3/8"). Parse numerator and denominator as integers, compute the floating-point value, and print both the decimal (to 4 decimal places) and the percentage (to 2 decimal places with a % sign).

Formula / Concept:
val = num / den; f"{val:.4f} {val:.2%}"

Input Format:
A single string "num/den" where den != 0.

Output Format:
Print decimal (4 places) and percentage (2 places with %) separated by a space.

Constraints:
-10^6 <= num <= 10^6, 1 <= den <= 10^6

Algorithm (Notes):

  1. Read input and split on "/" into num and den.
  2. Cast both to int and compute val = num / den.
  3. Print f"{val:.4f} {val:.2%}" using Python percentage format specifier.
";}i:1;O:8:"stdClass":4:{s:2:"id";i:770;s:5:"title";s:47:"Mixed Base Sum (Binary, Octal, and Hexadecimal)";s:5:"level";s:4:"Hard";s:8:"question";s:1025:"

Problem Name: Mixed Base Sum (Binary, Octal, and Hexadecimal)

Problem Description:
Read three strings on one line: a binary number B, an octal number O, and a hexadecimal number H (without prefixes). Convert each to decimal using int(s, base) and print their sum in decimal and uppercase hexadecimal.

Formula / Concept:
total = int(b, 2) + int(o, 8) + int(h, 16)

Input Format:
Three space-separated strings: B (base 2), O (base 8), H (base 16).

Output Format:
Print the decimal sum and uppercase hexadecimal sum separated by a space.

Constraints:
Each input represents a non-negative integer <= 10^8.

Algorithm (Notes):

  1. Read b_str, o_str, h_str using input().split().
  2. Convert using int(b_str, 2), int(o_str, 8), and int(h_str, 16).
  3. Sum the three integers and print both decimal and :X formatted hex.
";}i:2;O:8:"stdClass":4:{s:2:"id";i:769;s:5:"title";s:58:"Parse HH:MM:SS Time into Total Seconds and Decimal Minutes";s:5:"level";s:4:"Hard";s:8:"question";s:1073:"

Problem Name: Parse HH:MM:SS Time into Total Seconds and Decimal Minutes

Problem Description:
Read a timestamp in HH:MM:SS format, parse hours, minutes, and seconds using split(":") and int(), then compute total seconds and total minutes (as a float formatted to 2 decimal places).

Formula / Concept:
total_sec = h * 3600 + m * 60 + s; total_min = total_sec / 60

Input Format:
A single string in HH:MM:SS format.

Output Format:
Print total seconds (integer) and total minutes (to 2 decimal places) separated by a space.

Constraints:
0 <= HH <= 99, 0 <= MM <= 59, 0 <= SS <= 59

Algorithm (Notes):

  1. Read the timestamp and split by ":".
  2. Cast hours, minutes, seconds to int.
  3. Compute total_sec = h * 3600 + m * 60 + s and total_min = total_sec / 60.
  4. Print total_sec and total_min formatted to 2 decimal places.
";}i:3;O:8:"stdClass":4:{s:2:"id";i:768;s:5:"title";s:45:"Scientific Notation and Fixed-Point Formatter";s:5:"level";s:6:"Medium";s:8:"question";s:931:"

Problem Name: Scientific Notation and Fixed-Point Formatter

Problem Description:
Read a floating-point number X and an integer precision P. Print X in fixed-point format with P decimals and in lowercase scientific notation with P decimals, separated by a space.

Formula / Concept:
f"{x:.{p}f} {x:.{p}e}"

Input Format:
Two space-separated values: float X and integer P.

Output Format:
Print fixed-point and scientific notation representations separated by a space.

Constraints:
-10^9 <= X <= 10^9, 0 <= P <= 6

Algorithm (Notes):

  1. Read x_str and p_str, cast x = float(x_str) and p = int(p_str).
  2. Use dynamic precision formatting f"{x:.{p}f} {x:.{p}e}".
  3. Print the formatted output.
";}i:4;O:8:"stdClass":4:{s:2:"id";i:767;s:5:"title";s:54:"Parse Date DD/MM/YYYY and Output ISO Format YYYY-MM-DD";s:5:"level";s:6:"Medium";s:8:"question";s:945:"

Problem Name: Parse Date DD/MM/YYYY and Output ISO Format YYYY-MM-DD

Problem Description:
Read a date string in D/M/YYYY or DD/MM/YYYY format, parse day, month, and year as integers, and output it zero-padded in ISO-8601 format YYYY-MM-DD.

Formula / Concept:
d, m, y = map(int, input().split("/")); f"{y:04d}-{m:02d}-{d:02d}"

Input Format:
A single date string in DD/MM/YYYY format.

Output Format:
Print the date in YYYY-MM-DD format.

Constraints:
1 <= d <= 31, 1 <= m <= 12, 1 <= y <= 9999

Algorithm (Notes):

  1. Split the input string by "/" and cast day, month, year to int.
  2. Format with zero padding: year to 4 digits, month and day to 2 digits.
  3. Print the ISO formatted date.
";}i:5;O:8:"stdClass":4:{s:2:"id";i:766;s:5:"title";s:38:"Convert Feet and Inches to Centimeters";s:5:"level";s:6:"Medium";s:8:"question";s:862:"

Problem Name: Convert Feet and Inches to Centimeters

Problem Description:
Read a height given as feet and inches (two integers) and convert it into centimeters using 1 foot = 12 inches and 1 inch = 2.54 cm.

Formula / Concept:
total_inches = feet * 12 + inches; cm = total_inches * 2.54

Input Format:
Two space-separated integers: feet and inches.

Output Format:
Print the height in centimeters formatted to 2 decimal places.

Constraints:
0 <= feet <= 100, 0 <= inches <= 11

Algorithm (Notes):

  1. Read feet and inches as integers.
  2. Compute total_inches = feet * 12 + inches.
  3. Multiply by 2.54 and print formatted to 2 decimal places.
";}i:6;O:8:"stdClass":4:{s:2:"id";i:765;s:5:"title";s:40:"Comma-Separated Integers Sum and Product";s:5:"level";s:6:"Medium";s:8:"question";s:858:"

Problem Name: Comma-Separated Integers Sum and Product

Problem Description:
Read four integers separated by commas (e.g., 2,3,4,5). Parse them using split(","), cast to int, and print their sum and product.

Formula / Concept:
a, b, c, d = map(int, input().split(","))

Input Format:
A single line containing four comma-separated integers.

Output Format:
Print the sum and product separated by a space.

Constraints:
-1000 <= a, b, c, d <= 1000

Algorithm (Notes):

  1. Read the line and split by comma ",".
  2. Convert all four tokens to int.
  3. Compute sum = a + b + c + d and prod = a * b * c * d and print both.
";}i:7;O:8:"stdClass":4:{s:2:"id";i:764;s:5:"title";s:27:"Formatted Item Invoice Line";s:5:"level";s:6:"Medium";s:8:"question";s:939:"

Problem Name: Formatted Item Invoice Line

Problem Description:
Read an item name, integer quantity, and unit price (float). Compute the total cost and print it in the format: "<item> x <qty> = $<total>" where total has thousands separators and 2 decimal places.

Formula / Concept:
f"{item} x {qty} = ${total:,.2f}"

Input Format:
Line 1: item name. Line 2: integer quantity. Line 3: float unit price.

Output Format:
Single formatted invoice line.

Constraints:
1 <= qty <= 10^6, 0 <= price <= 10^6

Algorithm (Notes):

  1. Read item, qty (int), and price (float).
  2. Compute total = qty * price.
  3. Print using Python format specifier ,.2f for comma grouping and 2 decimal places.
";}i:8;O:8:"stdClass":4:{s:2:"id";i:763;s:5:"title";s:35:"Base-N String to Decimal Conversion";s:5:"level";s:6:"Medium";s:8:"question";s:815:"

Problem Name: Base-N String to Decimal Conversion

Problem Description:
Given a string S representing a non-negative integer in base B (2 <= B <= 36), cast it to a base-10 integer using int(S, B) and print the decimal value.

Formula / Concept:
int(S, B)

Input Format:
One line containing string S and integer base B separated by a space.

Output Format:
Print the base-10 integer value.

Constraints:
2 <= B <= 36, 1 <= len(S) <= 20

Algorithm (Notes):

  1. Read s and b_str using input().split().
  2. Cast b = int(b_str) and convert using int(s, b).
  3. Print the resulting decimal integer.
";}i:9;O:8:"stdClass":4:{s:2:"id";i:762;s:5:"title";s:54:"Float Truncation, Nearest Integer, and Fractional Part";s:5:"level";s:4:"Easy";s:8:"question";s:899:"

Problem Name: Float Truncation, Nearest Integer, and Fractional Part

Problem Description:
Read a positive floating-point number X. Print its truncated integer part using int(X), its rounded integer using round(X), and its fractional part (X - int(X)) formatted to 4 decimal places.

Formula / Concept:
int(x), round(x), x - int(x)

Input Format:
A single non-negative floating-point number X.

Output Format:
Print int(X), round(X), and fractional part (to 4 decimals) separated by spaces.

Constraints:
0 <= X <= 10^6

Algorithm (Notes):

  1. Read x as float.
  2. Compute trunc = int(x), rnd = round(x), and frac = x - trunc.
  3. Print trunc, rnd, and frac formatted to 4 decimal places.
";}i:10;O:8:"stdClass":4:{s:2:"id";i:761;s:5:"title";s:40:"String Concatenation vs Integer Addition";s:5:"level";s:4:"Easy";s:8:"question";s:897:"

Problem Name: String Concatenation vs Integer Addition

Problem Description:
Read two numeric strings S1 and S2. First print their string concatenation (S1 + S2), and on the same line separated by a space, print their numeric sum after casting both to int.

Formula / Concept:
s1 + s2 and int(s1) + int(s2)

Input Format:
Two space-separated numeric strings S1 and S2.

Output Format:
Print the concatenated string and the integer sum separated by a space.

Constraints:
0 <= int(S1), int(S2) <= 10^9

Algorithm (Notes):

  1. Read s1 and s2 as strings using input().split().
  2. Compute concat = s1 + s2 and num_sum = int(s1) + int(s2).
  3. Print concat and num_sum separated by a space.
";}i:11;O:8:"stdClass":4:{s:2:"id";i:760;s:5:"title";s:45:"Binary, Octal, and Hexadecimal Representation";s:5:"level";s:4:"Easy";s:8:"question";s:801:"

Problem Name: Binary, Octal, and Hexadecimal Representation

Problem Description:
Read a non-negative integer N and print its binary, octal, and uppercase hexadecimal representations without prefixes (no 0b, 0o, 0x).

Formula / Concept:
f"{n:b} {n:o} {n:X}"

Input Format:
A single non-negative integer N.

Output Format:
Print binary, octal, and uppercase hexadecimal representations separated by spaces.

Constraints:
0 <= N <= 10^9

Algorithm (Notes):

  1. Read N as an integer.
  2. Use Python format specifiers :b, :o, and :X inside an f-string.
  3. Print the resulting string.
";}i:12;O:8:"stdClass":4:{s:2:"id";i:759;s:5:"title";s:45:"Character to ASCII Code and Code to Character";s:5:"level";s:4:"Easy";s:8:"question";s:869:"

Problem Name: Character to ASCII Code and Code to Character

Problem Description:
Read a single character C and an integer ASCII code K on two lines. Print the ASCII value of C using ord() and the character corresponding to K using chr().

Formula / Concept:
ord(c), chr(k)

Input Format:
Line 1: a single printable character C. Line 2: an integer K (32 <= K <= 126).

Output Format:
Print ord(C) and chr(K) separated by a space.

Constraints:
32 <= K <= 126

Algorithm (Notes):

  1. Read character c = input()[0] and integer k = int(input()).
  2. Use ord(c) to get the ASCII integer and chr(k) to get the character.
  3. Print both separated by a space.
";}i:13;O:8:"stdClass":4:{s:2:"id";i:758;s:5:"title";s:48:"Sum and Average of Three Space-Separated Numbers";s:5:"level";s:4:"Easy";s:8:"question";s:904:"

Problem Name: Sum and Average of Three Space-Separated Numbers

Problem Description:
Read three space-separated floating-point numbers from a single line, cast them to float, and print their sum and average formatted to 2 decimal places.

Formula / Concept:
a, b, c = map(float, input().split()); avg = (a + b + c) / 3

Input Format:
One line containing three space-separated numbers.

Output Format:
Print Sum and Average formatted to 2 decimal places separated by a space.

Constraints:
-10^6 <= a, b, c <= 10^6

Algorithm (Notes):

  1. Split the input line and map each token to float.
  2. Compute total = a + b + c and avg = total / 3.
  3. Print total and avg formatted to 2 decimal places.
";}i:14;O:8:"stdClass":4:{s:2:"id";i:757;s:5:"title";s:32:"Formatted Student Profile Output";s:5:"level";s:4:"Easy";s:8:"question";s:993:"

Problem Name: Formatted Student Profile Output

Problem Description:
Read a student's name (string), age (integer), and GPA (float) on three separate lines, and print a formatted profile string: "Name: <name> | Age: <age> | GPA: <gpa>" with GPA rounded to 2 decimal places.

Formula / Concept:
f"Name: {name} | Age: {age} | GPA: {gpa:.2f}"

Input Format:
Line 1: Name (string). Line 2: Age (integer). Line 3: GPA (float).

Output Format:
Single formatted line as specified.

Constraints:
1 <= len(Name) <= 50, 1 <= Age <= 120, 0.0 <= GPA <= 10.0

Algorithm (Notes):

  1. Read name using input().strip().
  2. Read age using int(input()) and gpa using float(input()).
  3. Print the formatted f-string with GPA to 2 decimal places.
";}}s:3:"mcq";a:0:{}s:8:"language";s:6:"python";}