Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- long t = Next();
- for(int ti = 0; ti < t; ti++) {
- long a = Next();
- long b = Next();
- long d = b - a + 1;
- d %= 9;
- if(d == 0)
- d = 9;
- List<long> ans = new List<long>();
- for(int i = 0; i < d; i++) {
- long item = (a + i) % 9;
- if(item == 0)
- item = 9;
- ans.Add(item);
- }
- ans.Sort();
- writer.Write(ans.Count);
- for(int i = 0; i < ans.Count; i++) {
- writer.Write(' ');
- writer.Write(ans[i]);
- }
- writer.WriteLine();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement