|
|
back to board1991. Битва у болота // please,need help! where is the mistake& import java.util.Scanner; /** * Created by Oxygen! on 25.01.2016. */ public class BitvaUBolota1991Var2 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int x=0,y=0; int n=sc.nextInt(); int k=sc.nextInt(); int a[]=new int[n]; for(int i=0; i<n; i++) { a[i]=sc.nextInt(); if(a[i]<=0) { y+=k-a[i]; } else { x+=a[i]-k; } System.out.println(x+" "+y); } } } |
|
|