.
package com.javarush.task.task18.task1808;
import java.io.*;
/*
Разделение файла
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String title1 = reader.readLine();
String title2 = reader.readLine();
String title3 = reader.readLine();
reader.close();
FileInputStream input1 = new FileInputStream(title1);
int num = input1.available();
int separ = 0;
if (num % 2 == 0) separ = num / 2;
else if (num % 2 != 0) {
num += 1;
separ = num / 2;
}
FileOutputStream output2 = new FileOutputStream(title2);
FileOutputStream output3 = new FileOutputStream(title3);
while (0 < separ) {
byte mas[] = new byte[1000];
int count = input1.read(mas);
output2.write(mas, 0, count);
separ--;
}
while (separ < input1.available()+separ) {
byte mas[] = new byte[1000];
int count = input1.read(mas);
output3.write(mas, 0, count);
}
input1.close();
output2.close();
output3.close();
}
}