class prime{
int i,n,j;
int [] prime = new int[100];
void primejudge(){
for(n = 2; n <= 100;n++){
for(i = 2;i<n;i++){
if(n % i == 0){
break;
}
if(n - 1 == i){
prime[j] = n;
j++;
}
}
}
}
int [] get(){
return prime;
}
int getj(){
return j;
}
}
class SUM{
int x,y,scores;
int [] prime = new int[100];
void SUM(int z){
for(x = 0; x < z; x++){
for(y = 0; y < z;y++){
scores = prime[x]*prime[y];
if(scores == 589){
System.
out.
println("A*B=589になるABの値"); System.
out.
println("A" +prime
[x
]); System.
out.
println("B" +prime
[y
]); }
}
}
}
}
class abc{
public static void main
(String[] args
){ int j = 0;
int [] prime;
prime p = new prime();
p.j =0;
p.primejudge();
prime = p.get();
j = p.getj();
SUM q = new SUM();
q.prime = prime;
q.SUM(j);
}
}
Y2xhc3MgcHJpbWV7CglpbnQgaSxuLGo7CglpbnQgW10gcHJpbWUgPSBuZXcgaW50WzEwMF07Cgl2b2lkIHByaW1lanVkZ2UoKXsKCQlmb3IobiA9IDI7IG4gPD0gMTAwO24rKyl7CgkJCWZvcihpID0gMjtpPG47aSsrKXsKCQkJCWlmKG4gJSBpID09IDApewoJCQkJCWJyZWFrOwoJCQkJfQoJCQkJaWYobiAtIDEgPT0gaSl7CgkJCQkJcHJpbWVbal0gPSBuOwoJCQkJCWorKzsKCQkJCX0KCQkJfQoJCX0KCX0KCWludCBbXSBnZXQoKXsKCQlyZXR1cm4gcHJpbWU7Cgl9CglpbnQgZ2V0aigpewoJCXJldHVybiBqOwoJfQp9CmNsYXNzIFNVTXsKCWludCB4LHksc2NvcmVzOwoJaW50IFtdIHByaW1lID0gbmV3IGludFsxMDBdOwoJdm9pZCBTVU0oaW50IHopewoJCWZvcih4ID0gMDsgeCA8IHo7IHgrKyl7CgkJCWZvcih5ID0gMDsgeSA8IHo7eSsrKXsKCQkJCXNjb3JlcyA9IHByaW1lW3hdKnByaW1lW3ldOwoJCQkJaWYoc2NvcmVzID09IDU4OSl7CgkJCQkJU3lzdGVtLm91dC5w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