Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.Locale;
- import java.util.StringTokenizer;
- public class E {
- String filename = "addition";//filename here, System.in/out if no file
- FastScanner in;
- PrintWriter out;
- int n;
- int k;
- int a;
- int b;
- int[] x;
- void solve() {
- //your code here
- n = in.nextInt();
- k = in.nextInt();
- a = in.nextInt();
- b = in.nextInt();
- x = new int[n];
- for (int i = 0; i < n; i++) {
- x[i] = in.nextInt();
- }
- }
- void run() throws IOException {
- InputStream input = System.in;
- OutputStream output = System.out;
- /* try {
- File f = new File(filename + ".in");
- if (f.exists() && f.canRead()) {
- input = new FileInputStream(f);
- output = new FileOutputStream(filename + ".out");
- }
- } catch (IOException e) {
- }*/
- in = new FastScanner(input);
- out = new PrintWriter(new BufferedOutputStream(output));
- solve();
- in.close();
- out.close();
- }
- public static void main(String[] args) throws IOException {
- Locale.setDefault(Locale.US);
- new E().run();
- }
- class FastScanner implements Closeable {
- private BufferedReader br;
- private StringTokenizer tokenizer;
- public FastScanner(InputStream stream) throws FileNotFoundException {
- br = new BufferedReader(new InputStreamReader(stream));
- }
- public String next() {
- while (tokenizer == null || !tokenizer.hasMoreTokens()) {
- try {
- tokenizer = new StringTokenizer(br.readLine());
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- return tokenizer.nextToken();
- }
- public String nextLine() {
- if (tokenizer == null || !tokenizer.hasMoreTokens()) {
- try {
- return br.readLine();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- return tokenizer.nextToken("\n");
- }
- public int nextInt() {
- return Integer.parseInt(next());
- }
- public long nextLong() {
- return Long.parseLong(next());
- }
- public double nextDouble() {
- return Double.parseDouble(next());
- }
- @Override
- public void close() throws IOException {
- br.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement