Skip to content

Instantly share code, notes, and snippets.

@Jack-Saleem
Created July 17, 2016 13:40
Show Gist options
  • Save Jack-Saleem/3682ede8c2247e0191f9591f90c57f2a to your computer and use it in GitHub Desktop.
Save Jack-Saleem/3682ede8c2247e0191f9591f90c57f2a to your computer and use it in GitHub Desktop.
codeforces 604A UncowedForces program in java
import java.util.Scanner;
public class UncowedForces
{
public static void main(String[] args)
{
Scanner z=new Scanner(System.in);
int m[]=new int[5];
int w[]=new int[5];
int x=0;
for(int i=0;i<5;i++){
m[i]=z.nextInt();
}
int s=0;
for(int i=0;i<5;i++){
w[i]=z.nextInt();
}
for(int i=0;i<5;i++){
x+=Math.max(0.3*500*(i+1), (250-m[i])*((500*(i+1))/250)-(50*w[i]));
}
s=50*s;
int sh=z.nextInt();
int ush=z.nextInt();
System.out.println(x-s+(100*sh)-(50*ush));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment