@@ -0,0 +1 @@
+main(){}
@@ -0,0 +1,36 @@
+#include<bits/stdc++.h>
+
+using namespace std;
+inline int f(int n) {
+ int tot = 0;
+ while (n % 7 == 0) {
+ ++tot;
+ n /= 7;
+ }
+ return tot;
+}
+inline int g(int n) {
+ while (n > 0) {
+ if (n % 10 == 7)++tot;
+ n /= 10;
+int main() {
+ int T;
+ cin >> T;
+ while (T--) {
+ int L, R;
+ cin >> L >> R;
+ for (int n = L; n <= R; n++) {
+ tot += f(n) + g(n);
+ cout << tot << endl;
+ return 0;
@@ -0,0 +1,19 @@
+ int n;
+ cin >> n;
+ while (n--) {
+ int x;
+ cin >> x;
+ if (x % 2 == 0) {
+ cout << x - 4 << " " << 4 << endl;
+ } else {
+ cout << x - 9 << " " << 9 << endl;
@@ -0,0 +1,17 @@
+ for (int a = 123; 3 * a <= 987; a++) {
+ int b = a * 2, c = 3 * a;
+ ostringstream oss;
+ oss << a << b << c;
+ string s = oss.str();
+ sort(s.begin(), s.end());
+ if (s == "123456789")
+ cout << a << b << c << endl;
@@ -0,0 +1,18 @@
+ int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
+ do {
+ int x = a[0] * 100 + a[1] * 10 + a[2];
+ int y = a[3] * 100 + a[4] * 10 + a[5];
+ int z = a[6] * 100 + a[7] * 10 + a[8];
+ if (y == 2 * x && z == 3 * x) {
+ cout << x << y << z << endl;
+ } while (next_permutation(a, a + 9));