Determine whether the given year is a leap year. (A leap year is divisible by 4 but not by 100, unless it is also divisible by 400.)
Determine whether a rook on a square with given coordinates (row and column) attacks a piece on another specified square.
Determine whether a bishop on a square with given coordinates (row and column) attacks a piece on another specified square.
Determine whether a queen on a square with given coordinates (row and column) attacks a piece on another specified square.
Determine whether a knight on a square with given coordinates (row and column) attacks a piece on another specified square.
Given a chocolate bar of size n × m squares, determine if it is possible to break off exactly k squares with a single straight-line break between squares (splitting into two rectangles).
Each edge square of a square board is given one counter. Could there be exactly k counters placed? (For example, a 2×2 board has 4 counters, a 6×6 board has 20.)
Solve the linear equation ax + b = 0 in integers.
Solve the rational equation (ax + b) / (cx + d) = 0 in integers.
An item costs a roubles and b kopeks. It was paid with c roubles and d kopeks. How much change should be returned?
Ice cream is sold in packs of 3 and 5 scoops. Can exactly k scoops be bought?
You can fry k cutlets at once in a pan. Each cutlet must be fried m minutes per side without interruption. What is the minimum time required to fry n cutlets on both sides?
Given coordinates of two points on a plane, determine if they lie in the same quadrant (all coordinates are non-zero).
-
-
-
-
A square on a chessboard is identified by two numbers (a, b) from 1 to 8. The first is the column, the second is the row. Given two squares, determine if a king can move from the first to the second in one move.
Given real numbers a, b, c, find all solutions of the quadratic equation ax² + bx + c = 0.
Determine the type of triangle (acute, obtuse, or right-angled) based on its side lengths.
Given a number n, complete the phrase “On the meadow grazes...” with the correct form of the word “cow” in Russian.
A tube ticket for 1 trip costs 15 roubles, for 10 trips – 125 roubles, and for 60 trips – 440 roubles. A passenger plans to take n trips. Determine how many of each ticket type should be purchased to cover at least n trips at the lowest cost.
A tube ticket for 1 trip costs 15 roubles, 5 trips – 70 roubles, 10 trips – 125 roubles, 20 trips – 230 roubles, and 60 trips – 440 roubles. A passenger plans to take n trips. Determine the optimal combination of tickets to cover at least n trips for the lowest total price.
For a cell at coordinates (x, y) in a table of size M × N, output the coordinates of its neighbours. Neighbours share a side with the given cell.
Given three integers A, B, and C, determine if there is at least one even and one odd number among them.
Given a number X, convert it to Roman numerals.
The mathematical function sign(x) is defined as: sign(x) = 1 if x > 0, sign(x) = -1 if x < 0, sign(x) = 0 if x = 0. Output the value of sign(x) for the given number.
In one of the problems on the site, the condition says: “If the given four-digit number is symmetric, output 1, otherwise output any other integer.” A pupil believes they solved the problem, but the system rejects it. They think it’s because they returned a different “any other number” than the expected one. Write a program that compares the system’s expected output and the student’s answer, and checks if the solution is correct.
You are given three numbers in separate lines. Sort them in non-decreasing order. The program must read a, b, c, reorder their values to ensure a ≤ b ≤ c, and output them.