Recently you have received two positive integer numbers xx and yy. You forgot them, but you remembered a shuffled list containing all divisors of xx (including 11 and xx) and all divisors of yy (including 11 and yy). If dd is a divisor of both number…
B. Tell Your World time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Connect the countless points with lines, till we reach the faraway yonder. There are n points on a coordinate plane, the i…
B. Divisors of Two Integers time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently you have received two positive integer numbers xx and yy. You forgot them, but you remembered a shuffled…
UVa10025 ? 1 ? 2 ? ... ? n = k problem The problem Given the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k? 1 ? 2 ? ... ? n = k For example: to obtain k = 12 , the expression to be used will be:…
一 题面 D. N Problems During K Days 二 分析 对于这题,刚开始我就是陷入了对公式的执着,企图用公式直接确定第一个数,然后试着去找序列.经过思考和手动模拟后发现是很难保证正确性的. 对于这题,第一步是很明确的,就是确定第一个数,如果给定了$N$和$K$,那么第一个数是可以确定的.因为如果我们只保证后一个数比当前数多1,并且确定第一个数是1,那么可以根据$K$确定对应的最小和$sum$ $sum = \frac{K(K+1)}{2}$ 这个公式应该比较基础.这样我们就可…
You are given qq queries in the following form: Given three integers lili, riri and didi, find minimum positive integer xixi such that it is divisible by didi and it does not belong to the segment [li,ri][li,ri]. Can you answer all the queries? Recal…