Another Dress Rehearsal URAL - 2035

If you have a long history of participating in programming contests, you should know that the dress rehearsal is the most important part of a contest. There are permanent participants who attend contests not because of results or promotional gifts from sponsors but specially to solve a new quiz prepared by Alexander Ipatov.

At Ural programming contests, dress rehearsals are made into a cult, and their problems are often prepared more thoroughly than the problems of main contests. For example, have you ever seen rejudging at a dress rehearsals? Now you understand it.

But however difficult problems the organizers prepare for a dress rehearsal, there is always the good old A +  B. Do you think it is simply copied from one contest to another? Of course not! Any self-respecting organizing committee considers it its duty to prepare its own A +  Bproblem with negative numbers and int64.

A contest is approaching, and Kirill has prepared a superdifficult set of tests and answers to them. Unfortunately, he forgot to backup the tests, and, after an update of the Hardsoft Doors operating system, all the test were lost. It will take some time before Kirill invents the Awesome Backup System, but that’s a different story.

Now Kirill has to recover the lost tests as soon as possible. He has answers to the tests, and he remembers that the summands A and B were integers such that 0 ≤ A ≤ X and 0 ≤ B ≤ Y. Help Kirill recover the tests!

Input

The only input line contains integers XY, and Cseparated with a space (0 ≤ XYC ≤ 10 9).

Output

Find integers A and B such that 0 ≤ A ≤ X, 0 ≤B ≤ Y, and A +  B =  C.

If Kirill is wrong and there are no such integers, output “Impossible” (without quotation marks). Otherwise, output the integersA and B separated with a space. If there are several pairs satisfying the conditions, output any of them.

Example

inputoutput
2 7 5
2 3
9 15 100
Impossible

 

AC代码(交换!!!不知道大小又是这个坑然后如果开始的时候交换的话那么输出的时候也要交换然后就是分情况讨论一下就好了)

Select Code

#include <iostream>
#include <bits/stdc++.h>
#include <cmath>
using namespace std;

int main()
{
    int x, y, c, t, f = 0;
    scanf("%d %d %d",&x,&y,&c);
    if(c>x+y)
        printf("Impossible\n");
    else
    {
        if(x>y)
        {
             t = x, x = y, y = t;
             f = 1;
        }
        if(c<=x)
           {
               if(f==0)
               {
                    printf("%d %d\n",0, c);
               }
               else
                printf("%d %d\n",c, 0);
           }
        else
           if(f==0)
             printf("%d %d\n", x, c-x);
           else
            printf("%d %d\n",c-x, x);
    }
    return 0;
}

 

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.sitech.prom.channelsettle.rehearsal.busi.compute.vo.ListResponseVo` out of START_ARRAY token at [Source: (PushbackInputStream); line: 1, column: 1] at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1464) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1238) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1190) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeFromArray(BeanDeserializer.java:604) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:190) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:166) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4482) ~[jackson-databind-2.11.0.jar:2.11.0] at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3487) ~[jackson-databind-2.11.0.jar:2.11.0] at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.readJavaType(AbstractJackson2HttpMessageConverter.java:239) ~[spring-web-5.2.6.RELEASE.jar:5.2.6.RELEASE] ... 21 common frames omitted
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值