import java.util.*; import java.io.*; import java.awt.geom.*; import java.math.*; public class No0294 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int n = in.nextInt(); int cnt = 0; ArrayList num = new ArrayList<>(); for (int i=0; i 0) { max -= num.get(i); cnt--; } else { max += num.get(i); } } max += x; cnt = tmp; long min = 0; if (cnt > 0) { min -= x; cnt--; for (int i=nn-2; i>=0; i--) { if (cnt > 0) { min -= num.get(i); cnt--; } else { min += num.get(i); } } } else { int[] a = new int[nn]; dig = 1; for (int i=size-1,j=0; i>=0; i--, j++) { if (j == nn) { j = 0; dig *= 10; } a[j] += num.get(i)*dig; } // trace(a); for (int i=0; i