#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <ctime>
#include <cctype>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pair;
const ll mod = 1e9 + 7;
const int INF = 0x7fffffff;
int n, x_0, y_0, x, y;
map<Pair, int> Map;
int main()
{
#ifdef __AiR_H
freopen("in.txt", "r", stdin);
#endif // __AiR_H_
scanf("%d %d %d", &n, &x_0, &y_0);
int ans = 0;
while (n--) {
scanf("%d %d", &x, &y);
int x_t = x - x_0, y_t = y - y_0;
if (x_t != 0 && y_t != 0) {
int gcd = __gcd(x_t, y_t);
x_t /= gcd, y_t /= gcd;
} else if (x_t == 0 && y_t != 0) {
y_t = 1;
} else if (x_t != 0 && y_t == 0) {
x_t = 1;
}
if (Map[make_pair(x_t, y_t)] == 0) {
Map[make_pair(x_t, y_t)] = 1;
Map[make_pair(-x_t, -y_t)] = 1;
++ans;
}
}
printf("%d\n", ans);
return 0;
}
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <ctime>
#include <cctype>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pair;
const ll mod = 1e9 + 7;
const int INF = 0x7fffffff;
int n, x, y;
map<Pair, int> Map_pair;
map<int, int> Map_x, Map_y;
int main()
{
#ifdef __AiR_H
freopen("in.txt", "r", stdin);
#endif // __AiR_H_
scanf("%d", &n);
ll cnt = 0;
while (n--) {
scanf("%d %d", &x, &y);
++Map_pair[make_pair(x, y)];
++Map_x[x], ++Map_y[y];
}
ll ans = 0;
map<int, int>::iterator itr;
for (itr = Map_x.begin(); itr != Map_x.end(); ++itr) {
int t = itr->second;
if (t > 1) {
ans += (ll)t * (t - 1) / 2;
}
}
for (itr = Map_y.begin(); itr != Map_y.end(); ++itr) {
int t = itr->second;
if (t > 1) {
ans += (ll)t * (t - 1) / 2;
}
}
map<Pair, int>::iterator itr_pair;
for (itr_pair = Map_pair.begin(); itr_pair != Map_pair.end(); ++itr_pair) {
int t = itr_pair->second;
if (t > 1) {
cnt += (ll)t * (t - 1) / 2;
}
}
printf("%lld\n", ans - cnt);
return 0;
}
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <ctime>
#include <cctype>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pair;
const ll mod = 1e9 + 7;
const int INF = 0x7fffffff;
string ans, cmd;
string dir;
int n;
int main()
{
#ifdef __AiR_H
freopen("in.txt", "r", stdin);
#endif // __AiR_H_
ans = "/";
scanf("%d", &n);
while (n--) {
cin >> cmd;
if (cmd == "pwd") {
cout << ans << endl;
} else {
cin >> dir;
dir += "/";
int len = dir.length();
cmd = "";
if (dir[0] == '/') {
ans = "/";
for (int i = 1; i < len; ++i) {
if (dir[i] != '/') {
cmd += dir[i];
} else {
if (cmd == "..") {
if (ans != "/") {
int len_t = ans.length();
int d_len = 1;
for (int i = len_t - 2; ans[i] != '/'; --i) {
++d_len;
}
ans = ans.substr(0, len_t - d_len);
}
} else {
ans += cmd;
}
if (ans[ans.length() - 1] != '/') {
ans += "/";
}
cmd = "";
}
}
} else {
for (int i = 0; i < len; ++i) {
if (dir[i] != '/') {
cmd += dir[i];
} else {
if (cmd == "..") {
if (ans != "/") {
int len_t = ans.length();
int d_len = 1;
for (int i = len_t - 2; ans[i] != '/'; --i) {
++d_len;
}
ans = ans.substr(0, len_t - d_len);
}
} else {
ans += cmd;
}
if (ans[ans.length() - 1] != '/') {
ans += "/";
}
cmd = "";
}
}
}
}
}
return 0;
}
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <ctime>
#include <cctype>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pair;
const ll mod = 1e9 + 7;
const int INF = 0x7fffffff;
map<string, string> Map;
int n;
string Old, New;
int main()
{
#ifdef __AiR_H
freopen("in.txt", "r", stdin);
#endif // __AiR_H_
scanf("%d", &n);
while (n--) {
cin >> Old >> New;
if (!Map.count(Old)) {
Map[Old] = Old;
}
Map[New] = Map[Old];
Map.erase(Old);
}
int Size = Map.size();
printf("%d\n", Size);
map<string, string>::iterator itr;
for (itr = Map.begin(); itr != Map.end(); ++itr) {
cout << itr->second << " " << itr->first << endl;
}
return 0;
}
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <ctime>
#include <cctype>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pair;
const int mod = 1e9 + 7;
const int INF = 0x7fffffff;
const int maxn = 1e5 + 10;
map<Pair, Pair> mp;
int n, x, y, z;
int main() {
#ifdef __AiR_H
freopen("in.txt", "r", stdin);
#endif // __AiR_H_
scanf("%d", &n);
int Max = 0, t = 0, ans1 = 0, ans2 = 0;
for (int i = 1; i <= n; ++i) {
scanf("%d %d %d", &x, &y, &z);
if (x > y) { swap(x, y); }
if (x > z) { swap(x, z); }
if (y > z) { swap(y, z); }
if (x > Max) { Max = x, ans1 = i; ans2 = 0; }
if (mp.count(make_pair(x, y))) {
if (x > Max) { Max = x; ans1 = i; ans2 = mp[make_pair(x, y)].second; }
}
if (mp.count(make_pair(x, z))) {
if (x > Max) { Max = x; ans1 = i; ans2 = mp[make_pair(x, z)].second; }
}
if (mp.count(make_pair(y, z))) {
t = min(y, mp[make_pair(y, z)].first + x);
if (t > Max) { Max = t; ans1 = i; ans2 = mp[make_pair(y, z)].second; }
}
if (!mp.count(make_pair(x, y)) || mp[make_pair(x, y)].first < z) {
mp[make_pair(x, y)] = make_pair(z, i);
}
if (!mp.count(make_pair(x, z)) || mp[make_pair(x, z)].first < y) {
mp[make_pair(x, z)] = make_pair(y, i);
}
if (!mp.count(make_pair(y, z)) || mp[make_pair(y, z)].first < x) {
mp[make_pair(y, z)] = make_pair(x, i);
}
}
if (ans2 == 0) {
printf("1\n");
printf("%d\n", ans1);
} else {
printf("2\n");
printf("%d %d\n", ans1, ans2);
}
return 0;
}