CF1458C-Latin Square 题目: 题目描述: You are given a square matrix of size $ n $ . Every row and every column of this matrix is a permutation of $ 1 $ , $ 2 $ , $ \ldots $ , $ n $ . Let $ a_{i, j} $ be the element at the intersection of $ i $ -th row and $ j
CF1458B-Glass Half Spilled 题目: 题目描述: There are $ n $ glasses on the table numbered $ 1, \ldots, n $ . The glass $ i $ can hold up to $ a_i $ units of water, and currently contains $ b_i $ units of water. You would like to choose $ k $ glasses and collect as much water in them as possible. To
CF1458A-Row GCD 题目: 题目描述: You are given two positive integer sequences $ a_1, \ldots, a_n $ and $ b_1, \ldots, b_m $ . For each $ j = 1, \ldots, m $ find the greatest common divisor of $ a_1 + b_j, \ldots, a_n + b_j $ . 输入格式: The first line contains two integers $ n $ and $
SP6286-SUMMUL - Sum of products 题目: 题目描述: One boy Petya decided to practice in addition and multiplication of numbers. For this he chose some positive integer n, and ordered all the ways to decompose it into two or more terms of positive integers, and the ways in different order terms are considered to be different (for example, for n = 3 there are three
CF1463F-Max Correct Set 题目: 题目描述: Let’s call the set of positive integers $ S $ correct if the following two conditions are met: $ S \subseteq {1, 2, \dots, n} $ ; if $ a \in S $ and $ b \in S $ , then $ |a-b| \neq x $ and $ |a-b| \neq y $ . For the given values $ n
CF1463E-Plan of Lectures 题目: 题目描述: Ivan is a programming teacher. During the academic year, he plans to give $ n $ lectures on $ n $ different topics. Each topic should be used in exactly one lecture. Ivan wants to choose which topic will he explain during the $ 1 $ -st, $ 2 $ -nd, …, $ n $ -th lecture — formally,