import java.util.*;
public class Chi
{ public static void main(String args[])
{ int x,y;
Scanner sc=new Scanner(System.in);
System.out.print("请输入头的数量:");
int head=sc.nextInt();
System.out.print("请输入脚的数量:");
int foot=sc.nextInt();
if(foot%2==0) //判断鸡兔数量前需判断腿的数量是否符合现实
{ x=2*head-foot/2;
y=head-x;
if(x>=0&&y>=0)
{ System.out.println("鸡的数量为:"+x+",兔的数量为:"+y); }
else
System.out.println("输入信息有误"); }
else
System.out.println("输入信息有误");
}
}