https://www.acmicpc.net/problem/2581
using System;
class Program
{
static void Main() {
string s=Console.ReadLine();
string s1=Console.ReadLine();
int m=int.Parse(s);
int n=int.Parse(s1);
int min=10000;
int sum=0;
int count=0;
for(int i=m;i<=n;i++){
if(i==1) count=1;
for(int j=2;j<i;j++){
if(i%j==0) count=1;
}
if(count==0){
sum+=i;
if(i<=min) min=i;
}
count=0;
}
if(sum==0) Console.Write("-1");
else{
Console.WriteLine(sum);
Console.Write(min);
}
}
}