CF1337A.Ichihime and Triangle

普及/提高-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Ichihime is the current priestess of the Mahjong Soul Temple. She claims to be human, despite her cat ears.

These days the temple is holding a math contest. Usually, Ichihime lacks interest in these things, but this time the prize for the winner is her favorite — cookies. Ichihime decides to attend the contest. Now she is solving the following problem.

You are given four positive integers aa, bb, cc, dd, such that abcda \leq b \leq c \leq d.

Your task is to find three integers xx, yy, zz, satisfying the following conditions:

  • axba \leq x \leq b.
  • bycb \leq y \leq c.
  • czdc \leq z \leq d.
  • There exists a triangle with a positive non-zero area and the lengths of its three sides are xx, yy, and zz.

Ichihime desires to get the cookie, but the problem seems too hard for her. Can you help her?

伊希美是麻将之魂神社现任巫女。尽管她长着猫耳,却坚称自己是人类。

近日,神社正在举办一场数学竞赛。通常情况下,伊希美对这类活动毫无兴趣;但这次冠军的奖品却是她最爱的——曲奇饼干!于是伊希美决定参加竞赛。此刻,她正着手解决如下问题:

给定四个正整数 aabbccdd,满足 abcda \leq b \leq c \leq d

你的任务是找出三个整数 xxyyzz,使其满足以下条件:

  • axba \leq x \leq b
  • bycb \leq y \leq c
  • czdc \leq z \leq d
  • 存在以 xxyyzz 为三边长的三角形,且该三角形面积为正(即非退化三角形)。

伊希美渴望得到曲奇饼干,但这个问题对她而言似乎过于困难。你能帮帮她吗?

输入格式

The first line contains a single integer tt (1t10001 \leq t \leq 1000) — the number of test cases.

The next tt lines describe test cases. Each test case is given as four space-separated integers aa, bb, cc, dd (1abcd1091 \leq a \leq b \leq c \leq d \leq 10^9).

第一行包含一个整数 tt1t10001 \leq t \leq 1000)—— 表示测试用例的数量。

接下来的 tt 行描述各个测试用例。每个测试用例由四个以空格分隔的整数 aabbccdd 给出(1abcd1091 \leq a \leq b \leq c \leq d \leq 10^9)。

输出格式

For each test case, print three integers xx, yy, zz — the integers you found satisfying the conditions given in the statement.

It is guaranteed that the answer always exists. If there are multiple answers, print any.

对于每个测试用例,输出三个整数 xxyyzz —— 即你找到的满足题目所述条件的整数。

保证答案一定存在。若存在多个答案,输出任意一个即可。

输入输出样例

  • 输入#1

    4
    1 3 5 7
    1 5 5 7
    100000 200000 300000 400000
    1 1 977539810 977539810

    输出#1

    3 4 5
    5 5 5
    182690 214748 300999
    1 977539810 977539810

说明/提示

One of the possible solutions to the first test case:

One of the possible solutions to the second test case:

第一个测试用例的一种可能解法:

第二个测试用例的一种可能解法:

输入解题思路,AI测评打分。不知道怎么写?

首页