    #include <iostream>
    #include <string>
    #include <algorithm>
    using namespace std;
    
    struct Friend {
    	string first_name;
    	string last_name;
    	string phone;
    };
    
    bool RemoveByName (vector<Friend>& black_book, const string& name) {
        vector<Friend>::iterator removed_it = remove_if(black_book.begin(), black_book.end(), [&name](const Friend& f){return f.first_name == name;});
        if (removed_it == black_book.end())
            return false;
        black_book.erase(removed_it, black_book.end());
        return true;
    }
    
    int main() {
        vector <Friend> black_book {
            Friend {"John", "Nash", "4155555555"},
            Friend {"Homer", "Simpson", "2064375555"}
        };
        if(RemoveByName(black_book, "John")) {
        	cout << "removed" << endl;
        } else {
        	cout << "not found" << endl;
        }
        if(RemoveByName(black_book, "Tom")) {
        	cout << "removed" << endl;
        } else {
        	cout << "not found" << endl;
        }
        for(int i = 0; i < black_book.size(); ++i) {
        	Friend& f = black_book.at(i);
        	cout << f.first_name << " " << f.last_name << " " << f.phone << endl;
        }
    	return 0;
    }
