public class SequenceSum {
public static List<int[]> findsum(int n){
List<int[]> result = new ArrayList<int[]> ();
int mid = (n+1)/2;
int small = 1;
int big = 2;
int cur_sum = small;
while(small < big && small < mid){
System.out.print("--- " + cur_sum + " ---");
if(cur_sum == n){
System.out.print("res:");
System.out.println(small + " " +(big - 1));
}
if (cur_sum <= n){
cur_sum += big;
big ++;
}
else{
cur_sum -= small;
small++;
}
}
return result;
}