Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.PrintWriter;
- import java.util.Scanner;
- /**
- *
- * @author =v
- */
- public class main {
- public static void main (String[] args){
- Scanner sc = null;
- PrintWriter pw = null;
- try {
- pw = new PrintWriter("OUT4.txt");
- sc = new Scanner(new File("DATA4.txt"));
- } catch (FileNotFoundException ex) {
- }
- int num, count = 0;
- for (int i = 0; i < 5; i++){
- num = Integer.parseInt(sc.next());
- int[] x = new int[num];
- int[] y = new int[num];
- for (int j = 0; j < num; j++){
- x[j] = Integer.parseInt(sc.next());
- y[j] = Integer.parseInt(sc.next());
- }
- for (int j = 0; j < num; j++){
- for (int k = j + 1; k < num - 1; k++){
- for (int l = k+ 1; l < num - 2; l++){
- if ((x[j] > 0 && x[k] > 0 && x[l] > 0) || (x[j] < 0 && x[k] < 0 && x[l] < 0)){
- } else if (((y[j] > 0 && y[k] > 0 && y[l] > 0))
- || y[j] < 0 && y[k] < 0 && y[l] < 0){
- } else {
- count++;
- }
- }
- }
- }
- pw.println(count);
- }
- pw.close();
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement