Rezultati

Up. imeNalogaJezikRezultatČas oddaje
domaco-2018 Presek Java 100/100OK 04. okt '18 @ 17:44

Test Točke Porabljen spomin Porabljen čas Status
#1 100/100 42,031 MiB 0,196 s OK

Ocenjevani program (presek.java):
import java.util.*;
public class presek {
	
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int stTestov = sc.nextInt();
		
		for(int i = 0; i < stTestov; i++) {
			int xP1 = sc.nextInt();
			int yP1 = sc.nextInt();
			int xP2 = sc.nextInt();
			int yP2 = sc.nextInt();
			
			int xK = sc.nextInt();
			int yK = sc.nextInt();
			int r = sc.nextInt();
			boolean jeKons = false;
			for(double j = xP1; j < xP2; j+=0.1) {
				
				for(double n = yP1; n < yP2; n+=0.1) {
					if((n-yK)*(n-yK) + (j-xK)*(j-xK) <= r*r) {
						System.out.printf("%.1f %.1f\n", j,n);
						jeKons = true;
						break;
					}
				}
				if(jeKons) {
					break;
				}
			}
			if(!jeKons) {
				System.out.println("Presek je prazen");
			}
		}
		
	}
	
}